@@ -39,6 +39,7 @@ struct hist_field {
39
39
unsigned int offset ;
40
40
unsigned int is_signed ;
41
41
struct hist_field * operands [HIST_FIELD_OPERANDS_MAX ];
42
+ struct hist_trigger_data * hist_data ;
42
43
};
43
44
44
45
static u64 hist_field_none (struct hist_field * field , void * event ,
@@ -420,7 +421,8 @@ static void destroy_hist_field(struct hist_field *hist_field,
420
421
kfree (hist_field );
421
422
}
422
423
423
- static struct hist_field * create_hist_field (struct ftrace_event_field * field ,
424
+ static struct hist_field * create_hist_field (struct hist_trigger_data * hist_data ,
425
+ struct ftrace_event_field * field ,
424
426
unsigned long flags )
425
427
{
426
428
struct hist_field * hist_field ;
@@ -432,6 +434,8 @@ static struct hist_field *create_hist_field(struct ftrace_event_field *field,
432
434
if (!hist_field )
433
435
return NULL ;
434
436
437
+ hist_field -> hist_data = hist_data ;
438
+
435
439
if (flags & HIST_FIELD_FL_HITCOUNT ) {
436
440
hist_field -> fn = hist_field_counter ;
437
441
goto out ;
@@ -445,7 +449,7 @@ static struct hist_field *create_hist_field(struct ftrace_event_field *field,
445
449
if (flags & HIST_FIELD_FL_LOG2 ) {
446
450
unsigned long fl = flags & ~HIST_FIELD_FL_LOG2 ;
447
451
hist_field -> fn = hist_field_log2 ;
448
- hist_field -> operands [0 ] = create_hist_field (field , fl );
452
+ hist_field -> operands [0 ] = create_hist_field (hist_data , field , fl );
449
453
hist_field -> size = hist_field -> operands [0 ]-> size ;
450
454
goto out ;
451
455
}
@@ -498,7 +502,7 @@ static void destroy_hist_fields(struct hist_trigger_data *hist_data)
498
502
static int create_hitcount_val (struct hist_trigger_data * hist_data )
499
503
{
500
504
hist_data -> fields [HITCOUNT_IDX ] =
501
- create_hist_field (NULL , HIST_FIELD_FL_HITCOUNT );
505
+ create_hist_field (hist_data , NULL , HIST_FIELD_FL_HITCOUNT );
502
506
if (!hist_data -> fields [HITCOUNT_IDX ])
503
507
return - ENOMEM ;
504
508
@@ -544,7 +548,7 @@ static int create_val_field(struct hist_trigger_data *hist_data,
544
548
}
545
549
}
546
550
547
- hist_data -> fields [val_idx ] = create_hist_field (field , flags );
551
+ hist_data -> fields [val_idx ] = create_hist_field (hist_data , field , flags );
548
552
if (!hist_data -> fields [val_idx ]) {
549
553
ret = - ENOMEM ;
550
554
goto out ;
@@ -654,7 +658,7 @@ static int create_key_field(struct hist_trigger_data *hist_data,
654
658
}
655
659
}
656
660
657
- hist_data -> fields [key_idx ] = create_hist_field (field , flags );
661
+ hist_data -> fields [key_idx ] = create_hist_field (hist_data , field , flags );
658
662
if (!hist_data -> fields [key_idx ]) {
659
663
ret = - ENOMEM ;
660
664
goto out ;
0 commit comments