perf rb_resort: Rename for_each() macros to for_each_entry()

To match the semantics for list.h in the kernel, that are the
interface we use in them.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Taeung Song <treeze.taeung@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-iaxuq2yu43mtb504j96q0axs@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 602a1f4d
...@@ -2550,7 +2550,7 @@ static size_t thread__dump_stats(struct thread_trace *ttrace, ...@@ -2550,7 +2550,7 @@ static size_t thread__dump_stats(struct thread_trace *ttrace,
printed += fprintf(fp, " (msec) (msec) (msec) (msec) (%%)\n"); printed += fprintf(fp, " (msec) (msec) (msec) (msec) (%%)\n");
printed += fprintf(fp, " --------------- -------- --------- --------- --------- --------- ------\n"); printed += fprintf(fp, " --------------- -------- --------- --------- --------- --------- ------\n");
resort_rb__for_each(nd, syscall_stats) { resort_rb__for_each_entry(nd, syscall_stats) {
struct stats *stats = syscall_stats_entry->stats; struct stats *stats = syscall_stats_entry->stats;
if (stats) { if (stats) {
double min = (double)(stats->min) / NSEC_PER_MSEC; double min = (double)(stats->min) / NSEC_PER_MSEC;
...@@ -2627,7 +2627,7 @@ static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp) ...@@ -2627,7 +2627,7 @@ static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp)
return 0; return 0;
} }
resort_rb__for_each(nd, threads) resort_rb__for_each_entry(nd, threads)
printed += trace__fprintf_thread(fp, threads_entry->thread, trace); printed += trace__fprintf_thread(fp, threads_entry->thread, trace);
resort_rb__delete(threads); resort_rb__delete(threads);
......
...@@ -35,7 +35,7 @@ DEFINE_RB_RESORT_RB(threads, strcmp(a->thread->shortname, ...@@ -35,7 +35,7 @@ DEFINE_RB_RESORT_RB(threads, strcmp(a->thread->shortname,
struct rb_node *nd; struct rb_node *nd;
resort_rb__for_each(nd, threads) { resort_rb__for_each_entry(nd, threads) {
struct thread *t = threads_entry; struct thread *t = threads_entry;
printf("%s: %d\n", t->shortname, t->tid); printf("%s: %d\n", t->shortname, t->tid);
} }
...@@ -123,7 +123,7 @@ static void __name##_sorted__init_entry(struct rb_node *nd, \ ...@@ -123,7 +123,7 @@ static void __name##_sorted__init_entry(struct rb_node *nd, \
struct __name##_sorted_entry *__name##_entry; \ struct __name##_sorted_entry *__name##_entry; \
struct __name##_sorted *__name = __name##_sorted__new struct __name##_sorted *__name = __name##_sorted__new
#define resort_rb__for_each(__nd, __name) \ #define resort_rb__for_each_entry(__nd, __name) \
for (__nd = rb_first(&__name->entries); \ for (__nd = rb_first(&__name->entries); \
__name##_entry = rb_entry(__nd, struct __name##_sorted_entry, \ __name##_entry = rb_entry(__nd, struct __name##_sorted_entry, \
rb_node), __nd; \ rb_node), __nd; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment