perf string: Export asprintf__tp_filter_pids()

Will be used directly in 'perf trace' for setting up the command line
argv array to pass to cmd_record, as this was how 'perf trace record'
was implemented, following the model used in 'perf kvm record', 'perf
sched record', etc.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-w3cuwjs63lxf5zpryy3145uv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2019-10-14 20:10:50 -03:00
parent b88b14db21
commit da949f507a
2 changed files with 5 additions and 1 deletions

View File

@ -21,6 +21,7 @@
#include "../perf.h"
#include "asm/bug.h"
#include "bpf-event.h"
#include "util/string2.h"
#include <signal.h>
#include <unistd.h>
#include <sched.h>
@ -959,7 +960,7 @@ int perf_evlist__append_tp_filter(struct evlist *evlist, const char *filter)
return err;
}
static char *asprintf__tp_filter_pids(size_t npids, pid_t *pids)
char *asprintf__tp_filter_pids(size_t npids, pid_t *pids)
{
char *filter;
size_t i;

View File

@ -4,6 +4,7 @@
#include <linux/string.h>
#include <linux/types.h>
#include <sys/types.h> // pid_t
#include <stddef.h>
#include <string.h>
@ -32,6 +33,8 @@ static inline char *asprintf_expr_not_in_ints(const char *var, size_t nints, int
return asprintf_expr_inout_ints(var, false, nints, ints);
}
char *asprintf__tp_filter_pids(size_t npids, pid_t *pids);
char *strpbrk_esc(char *str, const char *stopset);
char *strdup_esc(const char *str);