1. 07 11月, 2021 1 次提交
  2. 20 10月, 2021 1 次提交
  3. 17 9月, 2021 2 次提交
    • N
      perf record: Add --synth option · 41b740b6
      Namhyung Kim 提交于
      Add an option to control the synthesizing behavior.
      
          --synth <no|all|task|mmap|cgroup>
                            Fine-tune event synthesis: default=all
      
      This can be useful when we know it doesn't need some synthesis like
      in a specific usecase and/or when using pipe:
      
        $ perf record -a --all-cgroups --synth cgroup -o- sleep 1 | \
        > perf report -i- -s cgroup
      
      Committer notes:
      
      Added a clarification to the man page entry for --synth that this is
      about pre-existing threads.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https //lore.kernel.org/r/20210811044658.1313391-2-namhyung@kernel.org
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      41b740b6
    • N
      perf tools: Allow controlling synthesizing PERF_RECORD_ metadata events during record · 84111b9c
      Namhyung Kim 提交于
      Depending on the use case, it might require some kind of synthesizing
      and some not.  Make it controllable to turn off heavy operations like
      MMAP for all tasks.
      
      Currently all users are converted to enable all the synthesis by
      default.  It'll be updated in the later patch.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https //lore.kernel.org/r/20210811044658.1313391-1-namhyung@kernel.org
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      84111b9c
  4. 09 9月, 2021 1 次提交
  5. 31 8月, 2021 1 次提交
  6. 12 8月, 2021 1 次提交
    • J
      perf tools: Enable on a list of CPUs for hybrid · 1d3351e6
      Jin Yao 提交于
      The 'perf record' and 'perf stat' commands have supported the option
      '-C/--cpus' to count or collect only on the list of CPUs provided. This
      option needs to be supported for hybrid as well.
      
      For hybrid support, it needs to check that the cpu list are available
      on hybrid PMU. One example for AlderLake, cpu0-7 is 'cpu_core', cpu8-11
      is 'cpu_atom'.
      
      Before:
      
        # perf stat -e cpu_core/cycles/ -C11 -- sleep 1
      
         Performance counter stats for 'CPU(s) 11':
      
           <not supported>      cpu_core/cycles/
      
               1.006179431 seconds time elapsed
      
      The 'perf stat' command silently returned "<not supported>" without any
      helpful information. It should error out pointing out that that cpu11
      was not 'cpu_core'.
      
      After:
      
        # perf stat -e cpu_core/cycles/ -C11 -- sleep 1
        WARNING: 11 isn't a 'cpu_core', please use a CPU list in the 'cpu_core' range (0-7)
        failed to use cpu list 11
      
      We also need to support the events without pmu prefix specified.
      
        # perf stat -e cycles -C11 -- sleep 1
        WARNING: 11 isn't a 'cpu_core', please use a CPU list in the 'cpu_core' range (0-7)
      
         Performance counter stats for 'CPU(s) 11':
      
                 1,067,373      cpu_atom/cycles/
      
               1.005544738 seconds time elapsed
      
      The perf tool creates two cycles events automatically, cpu_core/cycles/ and
      cpu_atom/cycles/. It checks that cpu11 is not 'cpu_core', then shows a warning
      for cpu_core/cycles/ and only count the cpu_atom/cycles/.
      
      If part of cpus are 'cpu_core' and part of cpus are 'cpu_atom', for example,
      
        # perf stat -e cycles -C0,11 -- sleep 1
        WARNING: use 0 in 'cpu_core' for 'cycles', skip other cpus in list.
        WARNING: use 11 in 'cpu_atom' for 'cycles', skip other cpus in list.
      
         Performance counter stats for 'CPU(s) 0,11':
      
                 1,914,704      cpu_core/cycles/
                 2,036,983      cpu_atom/cycles/
      
               1.005815641 seconds time elapsed
      
      It now automatically selects cpu0 for cpu_core/cycles/, selects cpu11 for
      cpu_atom/cycles/, and output with some warnings.
      
      Some more complex examples,
      
        # perf stat -e cycles,instructions -C0,11 -- sleep 1
        WARNING: use 0 in 'cpu_core' for 'cycles', skip other cpus in list.
        WARNING: use 11 in 'cpu_atom' for 'cycles', skip other cpus in list.
        WARNING: use 0 in 'cpu_core' for 'instructions', skip other cpus in list.
        WARNING: use 11 in 'cpu_atom' for 'instructions', skip other cpus in list.
      
         Performance counter stats for 'CPU(s) 0,11':
      
                 2,780,387      cpu_core/cycles/
                 1,583,432      cpu_atom/cycles/
                 3,957,277      cpu_core/instructions/
                 1,167,089      cpu_atom/instructions/
      
               1.006005124 seconds time elapsed
      
        # perf stat -e cycles,cpu_atom/instructions/ -C0,11 -- sleep 1
        WARNING: use 0 in 'cpu_core' for 'cycles', skip other cpus in list.
        WARNING: use 11 in 'cpu_atom' for 'cycles', skip other cpus in list.
        WARNING: use 11 in 'cpu_atom' for 'cpu_atom/instructions/', skip other cpus in list.
      
         Performance counter stats for 'CPU(s) 0,11':
      
                 3,290,301      cpu_core/cycles/
                 1,953,073      cpu_atom/cycles/
                 1,407,869      cpu_atom/instructions/
      
               1.006260912 seconds time elapsed
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jin Yao <yao.jin@intel.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https //lore.kernel.org/r/20210723063433.7318-4-yao.jin@linux.intel.com
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1d3351e6
  7. 02 8月, 2021 2 次提交
  8. 10 7月, 2021 3 次提交
  9. 01 6月, 2021 1 次提交
    • N
      perf record: Move probing cgroup sampling support · 4f2abe91
      Namhyung Kim 提交于
      I found that checking cgroup sampling support using the missing features
      doesn't work on old kernels.  Because it added both attr.cgroup bit and
      PERF_SAMPLE_CGROUP bit, it needs to check whichever comes first (usually
      the actual event, not dummy).
      
      But it only checks the attr.cgroup bit which is set only in the dummy
      event so cannot detect failtures due the sample bits.  Also we don't
      ignore the missing feature and retry, it'd be better checking it with
      the API probing logic.
      
      Committer notes:
      
      Extracted the minimal part to check using the new cgroup API probe
      routine, the part that removes the cgroup member can be left for further
      discussion.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210527182835.1634339-1-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4f2abe91
  10. 12 5月, 2021 1 次提交
    • A
      perf record: Set timestamp boundary for AUX area events · 66286ed3
      Adrian Hunter 提交于
      AUX area data is not processed by 'perf record' and consequently the
       --timestamp-boundary option may result in no values for "time of first
      sample" and "time of last sample". However there are non-sample events
      that can be used instead, namely 'itrace_start' and 'aux'.
      'itrace_start' is issued before tracing starts, and 'aux' is issued
      every time data is ready.
      
      Implement tool callbacks for those two for 'perf record', to update the
      timestamp boundary.
      
      Example:
      
       $ perf record -e intel_pt//u --timestamp-boundary uname
       Linux
       [ perf record: Woken up 1 times to write data ]
       [ perf record: Captured and wrote 0.022 MB perf.data ]
       $ perf script --header-only | grep "time of"
       # time of first sample : 4574.835541
       # time of last sample : 4574.835907
       $ perf script --itrace=be -F-ip | head -1
                 uname 13752 [001]  4574.835589:          1 branches:uH:
       $ perf script --itrace=be -F-ip | tail -1
                 uname 13752 [001]  4574.835867:          1 branches:uH:
       $
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lore.kernel.org/lkml/20210503064222.5319-1-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      66286ed3
  11. 29 4月, 2021 2 次提交
    • J
      perf record: Uniquify hybrid event name · 91c0f5ec
      Jin Yao 提交于
      For perf-record, it would be useful to tell user the pmu which the
      event belongs to.
      
      For example,
      
        # perf record -a -- sleep 1
        # perf report
      
        # To display the perf.data header info, please use --header/--header-only options.
        #
        #
        # Total Lost Samples: 0
        #
        # Samples: 106  of event 'cpu_core/cycles/'
        # Event count (approx.): 22043448
        #
        # Overhead  Command       Shared Object            Symbol
        # ........  ............  .......................  ............................
        #
        ...
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Reviewed-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20210427070139.25256-18-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      91c0f5ec
    • J
      perf record: Create two hybrid 'cycles' events by default · b53a0755
      Jin Yao 提交于
      When evlist is empty, for example no '-e' specified in perf record,
      one default 'cycles' event is added to evlist.
      
      While on hybrid platform, it needs to create two default 'cycles'
      events. One is for cpu_core, the other is for cpu_atom.
      
      This patch actually calls evsel__new_cycles() two times to create
      two 'cycles' events.
      
        # ./perf record -vv -a -- sleep 1
        ...
        ------------------------------------------------------------
        perf_event_attr:
          size                             120
          config                           0x400000000
          { sample_period, sample_freq }   4000
          sample_type                      IP|TID|TIME|ID|CPU|PERIOD
          read_format                      ID
          disabled                         1
          inherit                          1
          freq                             1
          precise_ip                       3
          sample_id_all                    1
          exclude_guest                    1
        ------------------------------------------------------------
        sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 5
        sys_perf_event_open: pid -1  cpu 1  group_fd -1  flags 0x8 = 6
        sys_perf_event_open: pid -1  cpu 2  group_fd -1  flags 0x8 = 7
        sys_perf_event_open: pid -1  cpu 3  group_fd -1  flags 0x8 = 9
        sys_perf_event_open: pid -1  cpu 4  group_fd -1  flags 0x8 = 10
        sys_perf_event_open: pid -1  cpu 5  group_fd -1  flags 0x8 = 11
        sys_perf_event_open: pid -1  cpu 6  group_fd -1  flags 0x8 = 12
        sys_perf_event_open: pid -1  cpu 7  group_fd -1  flags 0x8 = 13
        sys_perf_event_open: pid -1  cpu 8  group_fd -1  flags 0x8 = 14
        sys_perf_event_open: pid -1  cpu 9  group_fd -1  flags 0x8 = 15
        sys_perf_event_open: pid -1  cpu 10  group_fd -1  flags 0x8 = 16
        sys_perf_event_open: pid -1  cpu 11  group_fd -1  flags 0x8 = 17
        sys_perf_event_open: pid -1  cpu 12  group_fd -1  flags 0x8 = 18
        sys_perf_event_open: pid -1  cpu 13  group_fd -1  flags 0x8 = 19
        sys_perf_event_open: pid -1  cpu 14  group_fd -1  flags 0x8 = 20
        sys_perf_event_open: pid -1  cpu 15  group_fd -1  flags 0x8 = 21
        ------------------------------------------------------------
        perf_event_attr:
          size                             120
          config                           0x800000000
          { sample_period, sample_freq }   4000
          sample_type                      IP|TID|TIME|ID|CPU|PERIOD
          read_format                      ID
          disabled                         1
          inherit                          1
          freq                             1
          precise_ip                       3
          sample_id_all                    1
          exclude_guest                    1
        ------------------------------------------------------------
        sys_perf_event_open: pid -1  cpu 16  group_fd -1  flags 0x8 = 22
        sys_perf_event_open: pid -1  cpu 17  group_fd -1  flags 0x8 = 23
        sys_perf_event_open: pid -1  cpu 18  group_fd -1  flags 0x8 = 24
        sys_perf_event_open: pid -1  cpu 19  group_fd -1  flags 0x8 = 25
        sys_perf_event_open: pid -1  cpu 20  group_fd -1  flags 0x8 = 26
        sys_perf_event_open: pid -1  cpu 21  group_fd -1  flags 0x8 = 27
        sys_perf_event_open: pid -1  cpu 22  group_fd -1  flags 0x8 = 28
        sys_perf_event_open: pid -1  cpu 23  group_fd -1  flags 0x8 = 29
        ------------------------------------------------------------
      
      We have to create evlist-hybrid.c otherwise due to the symbol
      dependency the perf test python would be failed.
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Reviewed-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20210427070139.25256-14-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b53a0755
  12. 16 4月, 2021 1 次提交
    • A
      perf record: Improve 'Workload failed' message printing events + what was exec'ed · 3535a696
      Arnaldo Carvalho de Melo 提交于
      Before:
      
        # perf record -a cycles,instructions,cache-misses
        Workload failed: No such file or directory
        #
      
      After:
      
        # perf record -a cycles,instructions,cache-misses
        Failed to collect 'cycles' for the 'cycles,instructions,cache-misses' workload: No such file or directory
        #
      
      Helps disambiguating other error scenarios:
      
        # perf record -a -e cycles,instructions,cache-misses bla
        Failed to collect 'cycles,instructions,cache-misses' for the 'bla' workload: No such file or directory
        # perf record -a cycles,instructions,cache-misses sleep 1
        Failed to collect 'cycles' for the 'cycles,instructions,cache-misses' workload: No such file or directory
        #
      
      When all goes well we're back to the usual:
      
        # perf record -a -e cycles,instructions,cache-misses sleep 1
        [ perf record: Woken up 3 times to write data ]
        [ perf record: Captured and wrote 3.151 MB perf.data (21242 samples) ]
        #
      Acked-by: NIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/20210414131628.2064862-3-acme@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3535a696
  13. 19 2月, 2021 2 次提交
  14. 21 1月, 2021 5 次提交
    • J
      perf tools: Add 'ping' control command · 47fddcb4
      Jiri Olsa 提交于
      Add a control 'ping' command to detect if perf is up and its control
      interface is operational.
      
      It will be used in following daemon patches to synchronize with record
      session - when control interface is up and running, we know that perf
      record is monitoring and ready to receive signals.
      
      Example session:
      
        terminal 1:
      
          # mkfifo control ack
          # perf record --control=fifo:control,ack
      
        terminal 2:
      
          # echo ping > control
          # cat ack
          ack
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Budankov <abudankov@huawei.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20201226232038.390883-5-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      47fddcb4
    • J
      perf tools: Add 'stop' control command · f186cd61
      Jiri Olsa 提交于
      Adding control 'stop' command to stop perf record.
      
      When it is received, perf will set the 'done' variable to 1 to stop its
      mmap ring buffer reading loop.
      
      Example session:
      
        terminal 1:
          # mkfifo control ack
          # perf record --control=fifo:control,ack
      
        terminal 2:
          # echo stop > control
      
        terminal 1:
          [ perf record: Woken up 7 times to write data ]
          [ perf record: Captured and wrote 3.214 MB perf.data (38280 samples) ]
          #
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Budankov <abudankov@huawei.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20201226232038.390883-4-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f186cd61
    • J
      perf tools: Add 'evlist' control command · 142544a9
      Jiri Olsa 提交于
      Add a new 'evlist' control command to display all the evlist events.
      When it is received, perf will scan and print current evlist into perf
      record terminal.
      
      The interface string for control file is:
      
        evlist [-v|-g|-F]
      
      The syntax follows perf evlist command:
        -F  Show just the sample frequency used for each event.
        -v  Show all fields.
        -g  Show event group information.
      
      Example session:
      
        terminal 1:
          # mkfifo control ack
          # perf record --control=fifo:control,ack -e '{cycles,instructions}'
      
        terminal 2:
          # echo evlist > control
      
        terminal 1:
          cycles
          instructions
          dummy:HG
      
        terminal 2:
          # echo 'evlist -v' > control
      
        terminal 1:
          cycles: size: 120, { sample_period, sample_freq }: 4000, sample_type:            \
          IP|TID|TIME|ID|CPU|PERIOD, read_format: ID, disabled: 1, inherit: 1, freq: 1,    \
          sample_id_all: 1, exclude_guest: 1
          instructions: size: 120, config: 0x1, { sample_period, sample_freq }: 4000,      \
          sample_type: IP|TID|TIME|ID|CPU|PERIOD, read_format: ID, inherit: 1, freq: 1,    \
          sample_id_all: 1, exclude_guest: 1
          dummy:HG: type: 1, size: 120, config: 0x9, { sample_period, sample_freq }: 4000, \
          sample_type: IP|TID|TIME|ID|CPU|PERIOD, read_format: ID, inherit: 1, mmap: 1,    \
          comm: 1, freq: 1, task: 1, sample_id_all: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, \
           bpf_event: 1
      
        terminal 2:
          # echo 'evlist -g' > control
      
        terminal 1:
          {cycles,instructions}
          dummy:HG
      
        terminal 2:
          # echo 'evlist -F' > control
      
        terminal 1:
          cycles: sample_freq=4000
          instructions: sample_freq=4000
          dummy:HG: sample_freq=4000
      
      This new evlist command is handy to get real event names when
      wildcards are used.
      
      Adding evsel_fprintf.c object to python/perf.so build, because
      it's now evlist.c dependency.
      
      Adding PYTHON_PERF define for python/perf.so compilation, so we
      can use it to compile in only evsel__fprintf from evsel_fprintf.c
      object.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Budankov <abudankov@huawei.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20201226232038.390883-3-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      142544a9
    • J
      perf tools: Allow to enable/disable events via control file · 991ae4eb
      Jiri Olsa 提交于
      Adding new control events to enable/disable specific event.
      The interface string for control file are:
      
        'enable <EVENT NAME>'
        'disable <EVENT NAME>'
      
      when received the command, perf will scan the current evlist
      for <EVENT NAME> and if found it's enabled/disabled.
      
      Example session:
      
        terminal 1:
          # mkfifo control ack perf.pipe
          # perf record --control=fifo:control,ack -D -1 --no-buffering -e 'sched:*' -o - > perf.pipe
      
        terminal 2:
          # cat perf.pipe | perf --no-pager script -i -
      
        terminal 1:
          Events disabled
      
        NOTE Above message will show only after read side of the pipe ('>')
        is started on 'terminal 2'. The 'terminal 1's bash does not execute
        perf before that, hence the delyaed perf record message.
      
        terminal 3:
          # echo 'enable sched:sched_process_fork' > control
      
        terminal 1:
          event sched:sched_process_fork enabled
      
        terminal 2:
          bash 33349 [034] 149587.674295: sched:sched_process_fork: comm=bash pid=33349 child_comm=bash child_pid=34056
          bash 33349 [034] 149588.239521: sched:sched_process_fork: comm=bash pid=33349 child_comm=bash child_pid=34057
      
        terminal 3:
          # echo 'enable sched:sched_wakeup_new' > control
      
        terminal 1:
          event sched:sched_wakeup_new enabled
      
        terminal 2:
          bash 33349 [034] 149632.228023: sched:sched_process_fork: comm=bash pid=33349 child_comm=bash child_pid=34059
          bash 33349 [034] 149632.228050:   sched:sched_wakeup_new: bash:34059 [120] success=1 CPU:036
          bash 33349 [034] 149633.950005: sched:sched_process_fork: comm=bash pid=33349 child_comm=bash child_pid=34060
          bash 33349 [034] 149633.950030:   sched:sched_wakeup_new: bash:34060 [120] success=1 CPU:036
      
      Committer testing:
      
      If I use 'sched:*' and then enable all events, I can't get 'perf record'
      to react to further commands, so I tested it with:
      
        [root@five ~]# perf record --control=fifo:control,ack -D -1 --no-buffering -e 'sched:sched_process_*' -o - > perf.pipe
        Events disabled
        Events enabled
        Events disabled
      
      And then it works as expected, so we need to fix this pre-existing
      problem.
      
      Another issue, we need to check if a event is already enabled or
      disabled and change the message to be clearer, i.e.:
      
        [root@five ~]# perf record --control=fifo:control,ack -D -1 --no-buffering -e 'sched:sched_process_*' -o - > perf.pipe
        Events disabled
      
      If we receive a 'disable' command, then it should say:
      
        [root@five ~]# perf record --control=fifo:control,ack -D -1 --no-buffering -e 'sched:sched_process_*' -o - > perf.pipe
        Events disabled
        Events already disabled
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Budankov <abudankov@huawei.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20201226232038.390883-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      991ae4eb
    • K
      perf record: Add support for PERF_SAMPLE_CODE_PAGE_SIZE · c1de7f3d
      Kan Liang 提交于
      Adds the infrastructure to sample the code address page size.
      
      Introduce a new --code-page-size option for perf record.
      Signed-off-by: NKan Liang <kan.liang@linux.intel.com>
      Originally-by: NStephane Eranian <eranian@google.com>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20210105195752.43489-4-kan.liang@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c1de7f3d
  15. 28 12月, 2020 1 次提交
    • J
      perf record: Add --buildid-mmap option to enable PERF_RECORD_MMAP2's build id · e29386c8
      Jiri Olsa 提交于
      Add --buildid-mmap option to enable build id in PERF_RECORD_MMAP2 events.
      
      It will only work if there's kernel support for that and it disables
      build id cache (implies --no-buildid).
      
      It's also possible to enable it permanently via config option in
      ~/.perfconfig file:
      
        [record]
        build-id=mmap
      
      Also added build_id bit in the verbose output for perf_event_attr:
      
        # perf record --buildid-mmap -vv
        ...
        perf_event_attr:
          type                             1
          size                             120
          ...
          build_id                         1
      
      Adding also missing text_poke bit.
      
      Committer testing:
      
        $ perf record -h build
      
         Usage: perf record [<options>] [<command>]
            or: perf record [<options>] -- <command> [<options>]
      
            -B, --no-buildid      do not collect buildids in perf.data
            -N, --no-buildid-cache
                                  do not update the buildid cache
                --buildid-all     Record build-id of all DSOs regardless of hits
                --buildid-mmap    Record build-id in map events
      
        $
      
        $ perf record --buildid-mmap sleep 1
        Failed: no support to record build id in mmap events, update your kernel.
        $
      
      After adding the needed kernel bits in a test kernel:
      
        $ perf record -vv --buildid-mmap sleep 1 |& grep -m1 build
        Enabling build id in mmap2 events.
        $ perf evlist -v
        cycles:u: size: 120, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|PERIOD, read_format: ID, disabled: 1, inherit: 1, exclude_kernel: 1, mmap: 1, comm: 1, freq: 1, enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1, build_id: 1
        $
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NIan Rogers <irogers@google.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Budankov <abudankov@huawei.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20201214105457.543111-16-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e29386c8
  16. 18 12月, 2020 1 次提交
  17. 01 12月, 2020 6 次提交
  18. 30 11月, 2020 4 次提交
  19. 05 9月, 2020 4 次提交