perf strlist: Make dupstr be the default and part of an extensible config parm

So that we can pass more info to strlist__new() without having to change
its function signature, just adding entries to the strlist_config struct
with sensible defaults for when those fields are not specified.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-5uaaler4931i0s9sedxjquhq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo
2015-07-20 12:13:34 -03:00
parent ab7322af8c
commit 4a77e2183f
10 changed files with 22 additions and 16 deletions

View File

@@ -2066,7 +2066,7 @@ static struct strlist *get_probe_trace_command_rawlist(int fd)
char *p;
struct strlist *sl;
sl = strlist__new(true, NULL);
sl = strlist__new(NULL, NULL);
fp = fdopen(dup(fd), "r");
while (!feof(fp)) {
@@ -2362,7 +2362,7 @@ static struct strlist *get_probe_trace_event_names(int fd, bool include_group)
rawlist = get_probe_trace_command_rawlist(fd);
if (!rawlist)
return NULL;
sl = strlist__new(true, NULL);
sl = strlist__new(NULL, NULL);
strlist__for_each(ent, rawlist) {
ret = parse_probe_trace_command(ent->s, &tev);
if (ret < 0)