1. 06 7月, 2015 9 次提交
    • A
      perf evsel: Introduce append_filter() method · 64ec84f5
      Arnaldo Carvalho de Melo 提交于
      To allow building filters in evsel->filter, that will eventually be
      applied via perf_evsel__apply_filter().
      
      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-sjfoes3pycx7nlpmgedca13v@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      64ec84f5
    • A
      perf evlist: Make perf_evlist__set_filter use perf_evsel__set_filter · 94ad89bc
      Arnaldo Carvalho de Melo 提交于
      Instead of calling perf_evsel__apply_filter straight away, so that
      we can, in the next patches, expand the filter with more conditions
      before actually calling the ioctl to pass the end result filter to
      the kernel.
      
      Now we need to call perf_evlist__apply_filters() after the filter
      is completely setup, i.e. do the ioctl calls.
      
      The perf_evlist__apply_filters() method was already in place, because
      that is the model for the other tools that receives filters in the
      command line: go on setting then in the evsel->filter and only at
      the end, after parsing the whole command line, apply them.
      
      We get, as a bonus, a more expressive message that states which
      event, if any, failed to have the filter applied to, with an
      error message stating what happened.
      
      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-f429pgz75ryz7tpe6v74etre@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      94ad89bc
    • A
      perf evsel: Introduce set_filter method · 12467ae4
      Arnaldo Carvalho de Melo 提交于
      Replaces existing filter string with the one provided.
      
      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-jst49z83li0yx3g18o54u51a@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      12467ae4
    • A
      perf evsel: Rename set_filter to apply_filter · f47805a2
      Arnaldo Carvalho de Melo 提交于
      We need to be able to go on constructing a complex filter in multiple
      stages, since we can only set one filter per event.
      
      For instance, we need to be able, in 'perf trace' to filter by the
      'common_pid' field all the time, if only for the tracer itself, to
      avoid a feedback loop, and, in addition, we may want to filter the
      raw_syscalls:sys_{enter,exit} events by its 'id' filter, when using
      'perf trace -e open,close' or 'perf trace -e !open,close', i.e. when
      we are interested in just a subset of syscalls or when we are not
      interested in it.
      
      So we will have:
      
         perf_evsel__set_filter(evsel, char *filter)
      
             Replaces whatever is in evsel->filter.
      
         perf_evsel__append_filter(evsel, const char *op, char *filter)
      
             Appends, using op ("&&" or "||") with what is in evsel->filter.
      
         perf_evsel__apply_filter(evsel, filter):
      
              That actually applies a filter, be it the one being
              constructed in evsel->filter, or any other, for tools
              with more specific ways to build the filter, issuing
              the appropriate ioctl for all the evsel fds.
      
      The same changes will be made to the evlist__{set,apply} variants to
      keep everything consistent.
      
      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-2s5z9xtpnc2lwio3cv5x0jek@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f47805a2
    • A
      perf tools: Asprintf like functions to format integer filter expression · 93ec4ce7
      Arnaldo Carvalho de Melo 提交于
        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: NArnaldo Carvalho de Melo <acme@redhat.com>
      93ec4ce7
    • A
      tools: Copy rbtree_augmented.h from the kernel · 307bc971
      Arnaldo Carvalho de Melo 提交于
      To complete the transitioning to not to share the same files with the
      kernel, also moving it from tools/perf/include/linux/ to
      tools/include/linux to make the whoke rbtree kit to other tools/ living
      codebases.
      
      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-5bxyehixafckqm6ez25alnfo@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      307bc971
    • A
      tools: Move rbtree.h from tools/perf/ · 03da23a3
      Arnaldo Carvalho de Melo 提交于
      The previous step, copying the contents minus the rcupdate.h parts, was
      done as a minimal fix, now do the move from tools/perf/.
      
      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-52fllxtsgmtke66pmv98mcma@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      03da23a3
    • A
      tools: Copy lib/rbtree.c to tools/lib/ · 3f735377
      Arnaldo Carvalho de Melo 提交于
      So that we can remove kernel specific stuff we've been stubbing out via
      a tools/include/linux/export.h that gets removed in this patch and to
      avoid breakages in the future like the one fixed recently where
      rcupdate.h started being used in rbtree.h.
      
      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-rxuzfsozpb8hv1emwpx06rm6@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3f735377
    • A
      perf tools: Copy rbtree.h from the kernel · 4407f967
      Arnaldo Carvalho de Melo 提交于
      We were using the include/linux/rbtree.h directly from the kernel,
      which broke the build as soon as it started using rcupdate.h, to
      avoid dragging the rcu header files into tools/, for which there is
      no use so far, grab a copy of rbtree.h.
      
      This is the minimal fix, later patches will copy as well lib/rbtree.c
      and move rbtree.h into tools/include/, etc.
      
      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-dfmuj0j63w4by7vhlh4hhn74@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4407f967
  2. 02 7月, 2015 1 次提交
  3. 26 6月, 2015 21 次提交
  4. 25 6月, 2015 1 次提交
  5. 24 6月, 2015 8 次提交