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 <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-0b5i2ki9c3di6706fxpticsb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
e5cadb93d0
commit
602a1f4daa
@ -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",
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
@ -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)) {
|
||||
|
@ -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 ||
|
||||
|
Loading…
Reference in New Issue
Block a user