From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2F94C43381 for ; Sat, 30 Mar 2019 15:43:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 89A5D204EC for ; Sat, 30 Mar 2019 15:43:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="T1uffvjI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="E6NiKifW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89A5D204EC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=trLNbJNNihWVEqXm9aJF3RXBa5wRWSCX7NL6YZx22lo=; b=T1uffvjIPgFYuu oWTX7C5/d7LjIRNnLpKJMeAE6OODTOfAWs/lqew702KgoD5hiKYmYIRfutYZqEBFfSwUWOxLjZp0g 8zpQfVkKrbKl9oOD3s8V6zc5eBs+CW1wrZYj/KfFESfs48vve8SmeNTPgZYj4zxCNDuVjYKmoWnqn 6j+bQVEIr8804W0EgVvRYzi3Pl+eS6qseN+OEcYdQBWyyeH+JbU6HnNJv2YiwHKUtBWfa+K6SWUe4 LSsz7sJqraLvAs7kIo0q8zVrddHTGhW6XReOFh5IQ3Wb1IaYVofaLh0t73SypTpeZLJpSajIAs1w/ lA0+sDumSJ2z8yO4WQjQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAG94-0000sw-K4; Sat, 30 Mar 2019 15:43:46 +0000 Received: from mail-yw1-xc41.google.com ([2607:f8b0:4864:20::c41]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAG91-0000sb-JR for linux-arm-kernel@lists.infradead.org; Sat, 30 Mar 2019 15:43:45 +0000 Received: by mail-yw1-xc41.google.com with SMTP id l5so1768469ywa.0 for ; Sat, 30 Mar 2019 08:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jNyrqoMRgPMfMlwc8ZpqJHdA4eFjEmxwLDy3LaJeQ0c=; b=E6NiKifWK8f09KVTj45Y30k0j7zSWuQEPy2CxCajJTzr3neY/Irsj3goh/cwVkQ7/Y 79Snv1rEH80cq7n99HzG8b8QPxm7mEgTktVvbKlA6B9//VajFWEA2DhrY5lUqnraTfXS MTXj1TpwGHmAIeUecpgQ0nve9hK3nNjSzSV8yUJRHEdJdi3PPd5MRq9O3h7Z1egTdKpN spZPBLkGJUNJZVfPlw+GBgdsrPkxMkacumP8A7Ix+EOO/v6E892tjWfmvGGLyrT0zz8i G4pQcgMm8Wc9q3thMfdnWd6akPYX1s9HcLJOPdSVmZKQ0o/QO1cSOGaRv+m8igA2dSyU 6l3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jNyrqoMRgPMfMlwc8ZpqJHdA4eFjEmxwLDy3LaJeQ0c=; b=sU2dQm55QkeaTjTdYqj3ZzpCOfnwybTO0+5A88qtPF3n5jxAmtOsW2zUmZxpUGpN66 /9iQpI/DA0PVRXfFjjgaDur3o12rJkXq36iNcbWvjQwm0wqrIbUYp0u0bfjmxq09fLu5 voMTnY0I7JVmVfEM9IGGU93l42XZJaKDHF9Xmq/foT6I06sk15QxRTX/nj7fsw4xszF6 0rp499jSQ9D8K7Ja6Pmoa5P2/0QdNXHCqANbHrG6xL5goGU2Qqp05VO8QfPndg2QfqLu g8fogkNvF2ip+WYdPywDQsIdU1CgqVbb8MqoBisYzk/yf1jAH0Wj1HW9LTuZzEsZWajY RQ8g== X-Gm-Message-State: APjAAAV+QBHp3jC89McYo6RsZPXeOcgqgEi3rZCxw4/FN+dH27SOnR3w f2B6soMiaCFuOskJ+0D32IsLkQ== X-Google-Smtp-Source: APXvYqypL+QVYQ9UghAak0EHnxqXRgyJakQu+Q3Wmtp3kAjj/AuqxPakVIiqGK0xspVAtpNqnsyfiw== X-Received: by 2002:a81:7c86:: with SMTP id x128mr20974646ywc.282.1553960621829; Sat, 30 Mar 2019 08:43:41 -0700 (PDT) Received: from leoy-ThinkPad-X240s (li931-65.members.linode.com. [45.56.113.65]) by smtp.gmail.com with ESMTPSA id d64sm2164528ywb.64.2019.03.30.08.43.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Mar 2019 08:43:40 -0700 (PDT) Date: Sat, 30 Mar 2019 23:43:25 +0800 From: Leo Yan To: Mathieu Poirier Subject: Re: [PATCH v2 13/16] coresight: tmc-etr: Allow events to use the same ETR buffer Message-ID: <20190330154325.GA21093@leoy-ThinkPad-X240s> References: <20190325215632.17013-1-mathieu.poirier@linaro.org> <20190325215632.17013-14-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190325215632.17013-14-mathieu.poirier@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190330_084343_673312_D08835A9 X-CRM114-Status: GOOD ( 12.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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