@@ -41,6 +41,10 @@ struct eprobe_data {
41
41
struct trace_eprobe * ep ;
42
42
};
43
43
44
+
45
+ #define for_each_trace_eprobe_tp (ep , _tp ) \
46
+ list_for_each_entry(ep, trace_probe_probe_list(_tp), tp.list)
47
+
44
48
static int __trace_eprobe_create (int argc , const char * argv []);
45
49
46
50
static void trace_event_probe_cleanup (struct trace_eprobe * ep )
@@ -640,7 +644,7 @@ static int disable_eprobe(struct trace_eprobe *ep,
640
644
static int enable_trace_eprobe (struct trace_event_call * call ,
641
645
struct trace_event_file * file )
642
646
{
643
- struct trace_probe * pos , * tp ;
647
+ struct trace_probe * tp ;
644
648
struct trace_eprobe * ep ;
645
649
bool enabled ;
646
650
int ret = 0 ;
@@ -662,8 +666,7 @@ static int enable_trace_eprobe(struct trace_event_call *call,
662
666
if (enabled )
663
667
return 0 ;
664
668
665
- list_for_each_entry (pos , trace_probe_probe_list (tp ), list ) {
666
- ep = container_of (pos , struct trace_eprobe , tp );
669
+ for_each_trace_eprobe_tp (ep , tp ) {
667
670
ret = enable_eprobe (ep , file );
668
671
if (ret )
669
672
break ;
@@ -680,8 +683,7 @@ static int enable_trace_eprobe(struct trace_event_call *call,
680
683
*/
681
684
WARN_ON_ONCE (ret != - ENOMEM );
682
685
683
- list_for_each_entry (pos , trace_probe_probe_list (tp ), list ) {
684
- ep = container_of (pos , struct trace_eprobe , tp );
686
+ for_each_trace_eprobe_tp (ep , tp ) {
685
687
disable_eprobe (ep , file -> tr );
686
688
if (!-- cnt )
687
689
break ;
@@ -699,7 +701,7 @@ static int enable_trace_eprobe(struct trace_event_call *call,
699
701
static int disable_trace_eprobe (struct trace_event_call * call ,
700
702
struct trace_event_file * file )
701
703
{
702
- struct trace_probe * pos , * tp ;
704
+ struct trace_probe * tp ;
703
705
struct trace_eprobe * ep ;
704
706
705
707
tp = trace_probe_primary_from_call (call );
@@ -716,10 +718,8 @@ static int disable_trace_eprobe(struct trace_event_call *call,
716
718
trace_probe_clear_flag (tp , TP_FLAG_PROFILE );
717
719
718
720
if (!trace_probe_is_enabled (tp )) {
719
- list_for_each_entry (pos , trace_probe_probe_list (tp ), list ) {
720
- ep = container_of (pos , struct trace_eprobe , tp );
721
+ for_each_trace_eprobe_tp (ep , tp )
721
722
disable_eprobe (ep , file -> tr );
722
- }
723
723
}
724
724
725
725
out :
0 commit comments