public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@linaro.org>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: suzuki.poulose@arm.com, alexander.shishkin@linux.intel.com,
	coresight@lists.linaro.org, peterz@infradead.org,
	mike.leach@arm.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 13/16] coresight: tmc-etr: Allow events to use the same ETR buffer
Date: Sat, 30 Mar 2019 23:43:25 +0800	[thread overview]
Message-ID: <20190330154325.GA21093@leoy-ThinkPad-X240s> (raw)
In-Reply-To: <20190325215632.17013-14-mathieu.poirier@linaro.org>

Hi Mathieu,

On Mon, Mar 25, 2019 at 03:56:29PM -0600, Mathieu Poirier wrote:
> This patch uses the pid of the process being traced to aggregate traces
> coming from different processors in the same sink, something that is
> required when collecting traces in CPU-wide mode when the CoreSight HW
> enacts a N:1 source/sink topology.

I tried to use kprobe to verify the flow, so I observe something is
not expected (Maybe I misunderstand it), please check the detailed
info as below.

- The testing steps are as below:

  # perf record -e cs_etm/@f6404000.etr/ -a -- sleep 10 &
  # ls
  # ls
  # ls

  So I expect the CoreSight to do global tracing for 10 seconds, and
  then simply execute 'ls' command for 3 times and these three
  processes will be traced into perf data.

- I used kprobe event to add dynamic points for function tracing
  tmc_alloc_etr_buffer() and tmc_etr_get_etr_buf():

  echo 'p:my_probe tmc_alloc_etr_buffer' > /sys/kernel/debug/tracing/kprobe_events
  echo 'p:my_probe2 0xffff000010ba63c4 pid=%x1:u32' >> kprobe_events

  When start the 'perf record' command it will create etr_perf and
  etr_buf for every CPU, but afterwards for the three 'ls' processes,
  I cannot see any any ftrace log for them.  So finally I capture the
  trace log as below, it only creates buffer for every CPU for one
  etr_perf and one etr_buf but has no any buffer is created for 'ls'
  processes.

#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
            perf-2502  [000] d...  2003.550571: my_probe: (tmc_alloc_etr_buffer+0x0/0x280)
            perf-2502  [000] d...  2003.550595: my_probe2: (tmc_alloc_etr_buffer+0xbc/0x280) pid=2502
            perf-2502  [000] d...  2003.556306: my_probe: (tmc_alloc_etr_buffer+0x0/0x280)
            perf-2502  [000] d...  2003.556329: my_probe2: (tmc_alloc_etr_buffer+0xbc/0x280) pid=2502
            perf-2502  [000] d...  2003.557694: my_probe: (tmc_alloc_etr_buffer+0x0/0x280)
            perf-2502  [000] d...  2003.557708: my_probe2: (tmc_alloc_etr_buffer+0xbc/0x280) pid=2502
            perf-2502  [000] d...  2003.559079: my_probe: (tmc_alloc_etr_buffer+0x0/0x280)
            perf-2502  [000] d...  2003.559095: my_probe2: (tmc_alloc_etr_buffer+0xbc/0x280) pid=2502
            perf-2502  [000] d...  2003.560567: my_probe: (tmc_alloc_etr_buffer+0x0/0x280)
            perf-2502  [000] d...  2003.560581: my_probe2: (tmc_alloc_etr_buffer+0xbc/0x280) pid=2502
            perf-2502  [000] d...  2003.561954: my_probe: (tmc_alloc_etr_buffer+0x0/0x280)
            perf-2502  [000] d...  2003.561965: my_probe2: (tmc_alloc_etr_buffer+0xbc/0x280) pid=2502
            perf-2502  [000] d...  2003.563338: my_probe: (tmc_alloc_etr_buffer+0x0/0x280)
            perf-2502  [000] d...  2003.563352: my_probe2: (tmc_alloc_etr_buffer+0xbc/0x280) pid=2502
            perf-2502  [000] d...  2003.564782: my_probe: (tmc_alloc_etr_buffer+0x0/0x280)
            perf-2502  [000] d...  2003.564796: my_probe2: (tmc_alloc_etr_buffer+0xbc/0x280) pid=2502


  Question: When every time execute 'ls' program, should we expect the
  tmc-etr driver to create etr_buf for every process?

- If I use the command 'perf report --sort pid --stdio' to output result,
  I also can only see one process and doesn't have any samples for new
  created 'ls' processes:

  # Samples: 168  of event 'branches'
  # Event count (approx.): 168
  #
  # Children      Self      Pid:Command
  # ........  ........  ...............
  #
     100.00%   100.00%     2502:perf

Thanks,
Leo Yan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-03-30 15:43 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 21:56 [PATCH v2 00/16] coresight: Add support for CPU-wide trace scenarios Mathieu Poirier
2019-03-25 21:56 ` [PATCH v2 01/16] coresight: pmu: Adding ITRACE property to cs_etm PMU Mathieu Poirier
2019-03-25 21:56 ` [PATCH v2 02/16] coresight: etm4x: Add kernel configuration for CONTEXTID Mathieu Poirier
2019-03-26 11:59   ` Suzuki K Poulose
2019-03-25 21:56 ` [PATCH v2 03/16] coresight: etm4x: Configure tracers to emit timestamps Mathieu Poirier
2019-03-26 11:53   ` Suzuki K Poulose
2019-03-25 21:56 ` [PATCH v2 04/16] coresight: Adding return code to sink::disable() operation Mathieu Poirier
2019-03-26 14:55   ` Suzuki K Poulose
2019-03-25 21:56 ` [PATCH v2 05/16] coresight: Move reference counting inside sink drivers Mathieu Poirier
2019-03-26 15:04   ` Suzuki K Poulose
2019-03-25 21:56 ` [PATCH v2 06/16] coresight: Properly address errors in sink::disable() functions Mathieu Poirier
2019-03-25 21:56 ` [PATCH v2 07/16] coresight: Properly address concurrency in sink::update() functions Mathieu Poirier
2019-03-25 21:56 ` [PATCH v2 08/16] coresight: perf: Clean up function etm_setup_aux() Mathieu Poirier
2019-03-25 21:56 ` [PATCH v2 09/16] coresight: perf: Refactor function free_event_data() Mathieu Poirier
2019-03-26 15:07   ` Suzuki K Poulose
2019-03-25 21:56 ` [PATCH v2 10/16] coresight: Communicate perf event to sink buffer allocation function Mathieu Poirier
2019-03-26 15:12   ` Suzuki K Poulose
2019-03-25 21:56 ` [PATCH v2 11/16] coresight: tmc-etr: Refactor function tmc_etr_setup_perf_buf() Mathieu Poirier
2019-03-26 15:29   ` Suzuki K Poulose
2019-03-26 16:29     ` Mathieu Poirier
2019-03-25 21:56 ` [PATCH v2 12/16] coresight: tmc-etr: Introduce the notion of process ID to ETR devices Mathieu Poirier
2019-03-26 16:46   ` Suzuki K Poulose
2019-03-26 18:06     ` Mathieu Poirier
2019-03-25 21:56 ` [PATCH v2 13/16] coresight: tmc-etr: Allow events to use the same ETR buffer Mathieu Poirier
2019-03-26 16:18   ` Suzuki K Poulose
2019-03-26 17:55     ` Mathieu Poirier
2019-03-27 11:32       ` Suzuki K Poulose
2019-03-27 17:01         ` Mathieu Poirier
2019-04-01 13:01           ` Suzuki K Poulose
2019-04-03  2:13             ` Mathieu Poirier
2019-03-30 15:43   ` Leo Yan [this message]
2019-04-01  7:29     ` Mathieu Poirier
2019-03-25 21:56 ` [PATCH v2 14/16] coresight: tmc-etr: Add support for CPU-wide trace scenarios Mathieu Poirier
2019-03-25 21:56 ` [PATCH v2 15/16] coresight: tmc-etf: " Mathieu Poirier
2019-03-25 21:56 ` [PATCH v2 16/16] coresight: etb10: " Mathieu Poirier
2019-03-27  7:52 ` [PATCH v2 00/16] coresight: " Leo Yan
2019-03-27 14:40   ` Mathieu Poirier
2019-03-27 14:44     ` Leo Yan
2019-04-11 18:52 ` Robert Walker
2019-04-16 19:37   ` Mathieu Poirier
2019-04-24 16:22     ` Robert Walker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190330154325.GA21093@leoy-ThinkPad-X240s \
    --to=leo.yan@linaro.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@arm.com \
    --cc=peterz@infradead.org \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox