• Arnaldo Carvalho de Melo's avatar
    perf tools: Asprintf like functions to format integer filter expression · 93ec4ce7
    Arnaldo Carvalho de Melo authored
      char *asprintf_expr_in_ints(const char *var, size_t nints, int *ints);
      char *asprintf_expr_not_in_ints(const char *var, size_t nints, int *ints);
    
    Example of output formatted with those functions:
    
      # ./tp_filter 6 12 2015
      asprintf_expr_in_ints:     id == 6 || id == 12 || id == 2015
      asprintf_expr_not_in_ints: id != 6 && id != 12 && id != 2015
      #
    
    It'll be used with, for instance, perf_evsel__set_filter_in_ints(), that
    will be used in turn to ask the kernel to filter out all raw_syscalls:*
    except for the ones specified by the user via:
    
     $ perf trace -e some,list,of,syscalls
    
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Borislav Petkov <bp@suse.de>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Don Zickus <dzickus@redhat.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-jt07vfp6bd8y50c05j1t7hrn@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    93ec4ce7
string.c 7.47 KB