perf tools: Rename strlist_for_each() macros to for_each_entry()
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: 602a1f4daa5d107e890fd4f5f558dedf6a0874f3 Gitweb: http://git.kernel.org/tip/602a1f4daa5d107e890fd4f5f558dedf6a0874f3 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Thu, 23 Jun 2016 11:31:20 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 23 Jun 2016 11:35:01 -0300
perf tools: Rename strlist_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 <[email protected]>
Cc David Ahern <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Milian Wolff <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Taeung Song <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/builtin-buildid-cache.c | 10 +++++----- tools/perf/builtin-probe.c | 4 ++-- tools/perf/builtin-trace.c | 2 +- tools/perf/util/probe-event.c | 4 ++-- tools/perf/util/probe-file.c | 8 ++++---- tools/perf/util/strlist.h | 4 ++-- tools/perf/util/symbol.c | 2 +- tools/perf/util/thread_map.c | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-)
tools/perf/builtin-buildid-cache.c +5 -5
@@ -209,7 +209,7 @@ static int build_id_cache__purge_path(const char *pathname)if (err) goto out; -strlist__for_each (pos, list) { +strlist__for_each_entry (pos, list) { err =build_id_cache__remove_s (pos->s);pr_debug ("Removing %s %s: %s\n" , pos->s, pathname, err ?"FAIL" :"Ok" );
@@ -343,7 +343,7 @@ int cmd_buildid_cache(int argc, const char **argv,if (add_name_list_str) { list =strlist__new (add_name_list_str,NULL );if (list) { -strlist__for_each (pos, list) +strlist__for_each_entry (pos, list)if (build_id_cache__add_file (pos->s)) {if (errno ==EEXIST ) { pr_debug("%s already in the cache\n",
@@ -361,7 +361,7 @@ int cmd_buildid_cache(int argc, const char **argv,if (remove_name_list_str) { list =strlist__new (remove_name_list_str,NULL );if (list) { -strlist__for_each (pos, list) +strlist__for_each_entry (pos, list)if (build_id_cache__remove_file (pos->s)) {if (errno ==ENOENT ) { pr_debug("%s wasn't in the cache\n",
@@ -379,7 +379,7 @@ int cmd_buildid_cache(int argc, const char **argv,if (purge_name_list_str) { list =strlist__new (purge_name_list_str,NULL );if (list) { -strlist__for_each (pos, list) +strlist__for_each_entry (pos, list)if (build_id_cache__purge_path (pos->s)) {if (errno ==ENOENT ) { pr_debug("%s wasn't in the cache\n",
@@ -400,7 +400,7 @@ int cmd_buildid_cache(int argc, const char **argv,if (update_name_list_str) { list =strlist__new (update_name_list_str,NULL );if (list) { -strlist__for_each (pos, list) +strlist__for_each_entry (pos, list)if (build_id_cache__update_file (pos->s)) {if (errno ==ENOENT ) { pr_debug("%s wasn't in the cache\n",
tools/perf/builtin-probe.c +2 -2
@@ -389,7 +389,7 @@ static int perf_del_probe_events(struct strfilter *filter) ret =probe_file__get_events (kfd, filter, klist);if (ret ==0 ) { -strlist__for_each (ent, klist) +strlist__for_each_entry (ent, klist)pr_info ("Removed event: %s\n" , ent->s); ret =probe_file__del_strlist (kfd, klist);
@@ -399,7 +399,7 @@ static int perf_del_probe_events(struct strfilter *filter) ret2 =probe_file__get_events (ufd, filter, ulist);if (ret2 ==0 ) { -strlist__for_each (ent, ulist) +strlist__for_each_entry (ent, ulist)pr_info ("Removed event: %s\n" , ent->s); ret2 =probe_file__del_strlist (ufd, ulist);
tools/perf/builtin-trace.c +1 -1
@@ -1247,7 +1247,7 @@ static int trace__validate_ev_qualifier(struct trace *trace) i =0 ; -strlist__for_each (pos, trace->ev_qualifier) { +strlist__for_each_entry (pos, trace->ev_qualifier) {const char *sc = pos->s;int id =syscalltbl__id (trace->sctbl, sc);
tools/perf/util/probe-event.c +2 -2
@@ -980,7 +980,7 @@ static int show_available_vars_at(struct debuginfo *dinfo,zfree (&vl->point.symbol); nvars =0 ;if (vl->vars) { -strlist__for_each (node, vl->vars) { +strlist__for_each_entry (node, vl->vars) { var =strchr (node->s,'\t' ) +1 ;if (strfilter__compare (_filter, var)) {fprintf (stdout,"\t\t%s\n" , node->s);
@@ -2333,7 +2333,7 @@ static int __show_perf_probe_events(int fd, bool is_kprobe,if (!rawlist)return -ENOMEM ; -strlist__for_each (ent, rawlist) { +strlist__for_each_entry (ent, rawlist) { ret =parse_probe_trace_command (ent->s, &tev);if (ret >=0 ) {if (!filter_probe_trace_event (&tev, filter))
tools/perf/util/probe-file.c +4 -4
@@ -178,7 +178,7 @@ static struct strlist *__probe_file__get_namelist(int fd, bool include_group)if (!rawlist)return NULL ; sl =strlist__new (NULL ,NULL ); -strlist__for_each (ent, rawlist) { +strlist__for_each_entry (ent, rawlist) { ret =parse_probe_trace_command (ent->s, &tev);if (ret <0 )break ;
@@ -281,7 +281,7 @@ int probe_file__get_events(int fd, struct strfilter *filter,if (!namelist)return -ENOENT ; -strlist__for_each (ent, namelist) { +strlist__for_each_entry (ent, namelist) { p =strchr (ent->s,':' );if ((p &&strfilter__compare (filter, p +1 )) ||strfilter__compare (filter, ent->s)) {
@@ -299,7 +299,7 @@ int probe_file__del_strlist(int fd, struct strlist *namelist)int ret =0 ;struct str_node *ent; -strlist__for_each (ent, namelist) { +strlist__for_each_entry (ent, namelist) { ret =__del_trace_probe_event (fd, ent);if (ret <0 )break ;
@@ -612,7 +612,7 @@ static int probe_cache_entry__write(struct probe_cache_entry *entry, int fd)if (ret < (int )iov[1 ].iov_len +2 ) goto rollback; -strlist__for_each (snode, entry->tevlist) { +strlist__for_each_entry (snode, entry->tevlist) { iov[0 ].iov_base = (void *)snode->s; iov[0 ].iov_len =strlen (snode->s); iov[1 ].iov_base = (void *)"\n" ; iov[1 ].iov_len =1 ;
tools/perf/util/strlist.h +2 -2
@@ -73,7 +73,7 @@ static inline struct str_node *strlist__next(struct str_node *sn)* @pos: the &struct str_node to use as a loop cursor. * @slist: the &struct strlist for loop. */ -#define strlist__for_each (pos, slist) \ +#define strlist__for_each_entry (pos, slist) \ for (pos = strlist__first(slist); pos; pos = strlist__next(pos))/**
@@ -83,7 +83,7 @@ static inline struct str_node *strlist__next(struct str_node *sn)* @n: another &struct str_node to use as temporary storage. * @slist: the &struct strlist for loop. */ -#define strlist__for_each_safe (pos, n, slist) \ +#define strlist__for_each_entry_safe (pos, n, slist) \ for (pos = strlist__first(slist), n = strlist__next(pos); pos;\ pos = n, n = strlist__next(n))#endif /* __PERF_STRLIST_H */
tools/perf/util/symbol.c +1 -1
@@ -1626,7 +1626,7 @@ static int find_matching_kcore(struct map *map, char *dir, size_t dir_sz)if (!dirs)return -1 ; -strlist__for_each (nd, dirs) { +strlist__for_each_entry (nd, dirs) {scnprintf (kallsyms_filename,sizeof (kallsyms_filename),"%s/%s/kallsyms" , dir, nd->s);if (!validate_kcore_addresses (kallsyms_filename, map)) {
tools/perf/util/thread_map.c +2 -2
@@ -202,7 +202,7 @@ static struct thread_map *thread_map__new_by_pid_str(const char *pid_str)if (!slist)return NULL ; -strlist__for_each (pos, slist) { +strlist__for_each_entry (pos, slist) { pid =strtol (pos->s, &end_ptr,10 ); if (pid == INT_MIN || pid == INT_MAX ||
@@ -278,7 +278,7 @@ struct thread_map *thread_map__new_by_tid_str(const char *tid_str)if (!slist)return NULL ; -strlist__for_each (pos, slist) { +strlist__for_each_entry (pos, slist) { tid =strtol (pos->s, &end_ptr,10 ); if (tid == INT_MIN || tid == INT_MAX ||