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=-6.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 A1B38C55ABD for ; Thu, 12 Nov 2020 08:59:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2E8F22100A for ; Thu, 12 Nov 2020 08:59:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PmVKK3C8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Tv3Z+0Dr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E8F22100A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lkq7dPjzCPyEKW8DdqGAgTNe8OFXYmkv5rlCEmVKIeQ=; b=PmVKK3C8bg+FhGCimn1A2+Nej KmuJl8zC447C/Ija5luuZGbH0ggqZOS/J0W4EobJARiNdt3ob77Ai5fxHXdgANlM/rTQ1mzPAEjBf WvlvluavOgyG6HsaspB0EO+PdhtKAPKcDpofWbbYOa1R86Eu3pdPCOvNnroW3uColOK9Gch+9CnvX VAqISTwHJOhXufUuImtmwLdKzi4W2ENK9DgaGNxhbA36JdCxZGxAyd8sCSTvwXVwOo8G5gib1WqnS SGAqQe4K5Ui+dv3ocxdue0+6lpHXSBMY4Y/lgOdwGIq1LKTDjwjfClqBd8QCZYG6+O7Z4HMtZLFot nTPzBeP2A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kd8Qo-0000og-7e; Thu, 12 Nov 2020 08:58:14 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kd8Qk-0000nv-Qq for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2020 08:58:11 +0000 Received: by mail-lf1-x142.google.com with SMTP id j205so7171101lfj.6 for ; Thu, 12 Nov 2020 00:58:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qf62U6JtJnGRJpljCc5qrSmhVkQLXrJw9OKe1PDuM/E=; b=Tv3Z+0DrNKfhwt71rWsOaLKNAZPCcfGkfMVTcuD4kXycMzvgVrAkkYPT3vh76MW7Oi ukoWkhHMY+qmonFGzaM2fq1jvtzPn+hQl7LXDo2Zn3t7H1q/IozAXWJQwdAiEZCmYame dejUus+E0gq6AxT/St/FA9vK205iht9cZNe2MeLcI/nNNvPclmZCpTSDPU9M6T/j2CVa JXXWEvx7DaD99AUwVCQE0uFA/9ArUJDllqV7TKuBE3XCY0dzrLQrpw3VVOAuJLKXFGz0 vP8lYcUVRLgUvutMo/DzCkTiKelSAlJQ6HgkH7bHFYkDmLBmq27mku4q4YCJhZPCMuLX sdiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qf62U6JtJnGRJpljCc5qrSmhVkQLXrJw9OKe1PDuM/E=; b=N6QG317FCVD/9IydcdoePBrRGdVxZTTMu/76Hxp4V0jAzZyyXcANQ6NZUQFI8gpvEs hsuRQy16A5zmk0BMwW29Tz4FImcV7rpdHwFXHLl1NgmPd3fdQZ80zuYzhBEW3eFInb45 VQkhu1RiSzDTf7Z0hNixPTmy/m2qf06h10/8YahnRbk8+firi0eqtaFUQxXAowtbzU7N 5vidy26CdZQFkq1nMXow06Oh2F4uu2w8NUkX4BEi4QP+oHCj6Nj7Bza0ZoNY0wDrK3NQ ySLQ3TPz12U0Z+dQFZnikqzIwG8N+9cbV7Thwph8mb1lTvOEU6pVXsNYtrPBOWcLz3Yo 60+Q== X-Gm-Message-State: AOAM530CgqVrpLxyAxVY4UslUyfxx6ICWOcrdUM9CsImlgub0tMxfCnC ltRYCbrU9LNLxiwcPOU97WiK+wf/bY7b1Gj28nc= X-Google-Smtp-Source: ABdhPJyDAdaIAD4o6PN1zIvrhzB4sLFXEkcXvlS5Jm0syNjCKpPyZuJnxWpUG83X+6Lrs8QSDG7qLOOv5W/cJIL3bEo= X-Received: by 2002:ac2:5235:: with SMTP id i21mr4220115lfl.473.1605171484208; Thu, 12 Nov 2020 00:58:04 -0800 (PST) MIME-Version: 1.0 References: <20200904024106.21478-1-lcherian@marvell.com> <2bd65f2d-5660-10b3-f51f-448221d78d3d@arm.com> In-Reply-To: From: Linu Cherian Date: Thu, 12 Nov 2020 14:27:52 +0530 Message-ID: Subject: Re: [PATCH v4 0/2] Make sysFS functional on topologies with per core sink To: Suzuki K Poulose X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_035810_972467_764566B8 X-CRM114-Status: GOOD ( 27.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel , Coresight ML , Mathieu Poirier , Linu Cherian , Mike Leach Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Suzuki, On Tue, Nov 10, 2020 at 8:27 PM Suzuki K Poulose wrote: > > Hi Linu > > On 11/10/20 12:57 PM, Linu Cherian wrote: > > Hi Suzuki, > > > ... > > >> We are facing some issues while trying out perf. This doesn't appear > >> to be related to your patch though. Will share the details once we > >> do some initial analysis on it. > >> > >> Thanks. > > > > # ./perf record -vvv -e cs_etm// --per-thread uname -a > > Using CPUID 0x00000000430f0b40 > > Attempting to add event pmu 'cs_etm' with '' that may result in non-fatal errors > > nr_cblocks: 0 > > affinity: SYS > > mmap flush: 1 > > comp level: 0 > > maps__set_modules_path_dir: cannot open > > /lib/modules/5.9.0-rc5-00116-g91c9ea890e1a dir > > Problems setting modules path maps, continuing anyway... > > ------------------------------------------------------------ > > perf_event_attr: > > type 8 > > size 120 > > { sample_period, sample_freq } 1 > > sample_type IP|TID|IDENTIFIER > > read_format ID > > disabled 1 > > enable_on_exec 1 > > sample_id_all 1 > > exclude_guest 1 > > ------------------------------------------------------------ > > sys_perf_event_open: pid 3333 cpu -1 group_fd -1 flags 0x8 = 5 > > ------------------------------------------------------------ > > perf_event_attr: > > type 1 > > size 120 > > config 0x9 > > { sample_period, sample_freq } 1 > > sample_type IP|TID|IDENTIFIER > > read_format ID > > disabled 1 > > exclude_kernel 1 > > exclude_hv 1 > > mmap 1 > > comm 1 > > enable_on_exec 1 > > task 1 > > sample_id_all 1 > > exclude_guest 1 > > mmap2 1 > > comm_exec 1 > > context_switch 1 > > ksymbol 1 > > bpf_event 1 > > ------------------------------------------------------------ > > sys_perf_event_open: pid 3333 cpu -1 group_fd -1 flags 0x8 = 6 > > mmap size 589824B > > AUX area mmap length 4194304 > > ------------------------------------------------------------ > > perf_event_attr: > > type 1 > > size 120 > > config 0x9 > > watermark 1 > > sample_id_all 1 > > bpf_event 1 > > { wakeup_events, wakeup_watermark } 1 > > ------------------------------------------------------------ > > sys_perf_event_open: pid -1 cpu -1 group_fd -1 flags 0x8 > > sys_perf_event_open failed, error -22 > > switching off bpf_event > > ------------------------------------------------------------ > > perf_event_attr: > > type 1 > > size 120 > > config 0x9 > > watermark 1 > > sample_id_all 1 > > { wakeup_events, wakeup_watermark } 1 > > ------------------------------------------------------------ > > sys_perf_event_open: pid -1 cpu -1 group_fd -1 flags 0x8 > > sys_perf_event_open failed, error -22 > > switching off cloexec flag > > ------------------------------------------------------------ > > perf_event_attr: > > type 1 > > size 120 > > config 0x9 > > watermark 1 > > sample_id_all 1 > > { wakeup_events, wakeup_watermark } 1 > > ------------------------------------------------------------ > > sys_perf_event_open: pid -1 cpu -1 group_fd -1 flags 0 > > sys_perf_event_open failed, error -22 > > switching off sample_id_all > > ------------------------------------------------------------ > > perf_event_attr: > > type 1 > > size 120 > > config 0x9 > > watermark 1 > > { wakeup_events, wakeup_watermark } 1 > > ------------------------------------------------------------ > > sys_perf_event_open: pid -1 cpu -1 group_fd -1 flags 0 > > sys_perf_event_open failed, error -22 > > Couldn't start the BPF side band thread: > > BPF programs starting from now on won't be annotatable > > Synthesizing auxtrace information > > cannot find cgroup mount point > > Couldn't synthesize cgroup events. > > Control descriptor is not initialized > > Linux marvell 5.9.0-rc5-00116-g91c9ea890e1a #823 SMP PREEMPT Tue Nov > > 10 10:49:15 IST 2020 aarch64 aarch64 aarch64 GNU/Linux > > > auxtrace idx 0 old 0 head 0xdd50 diff 0xdd50 > > I haven't seen this in the normal verbose output. > > > [ perf record: Woken up 1 times to write data ] > > symbol:init_start file:(null) line:0 offset:0 return:0 lazy:(null) > > snip .. > > symbol:memory_mallopt file:(null) line:0 offset:0 return:0 lazy:(null) > > failed to write feature CPUDESC > > failed to write feature MEM_TOPOLOGY > > failed to write feature CPU_PMU_CAPS > > [ perf record: Captured and wrote 0.056 MB perf.data ] > > > > # ./perf report > > 0x368 [0x50]: failed to process type: 1 [Cannot allocate memory] > > Error: > > failed to process sample > > I have no clue about it. Are you able to run it under GDB ? (Looks like > you have built the perf, so if you have sources, it may be a good idea > to run under the GDB and figure out where that error is coming from). > Yeah gdb helped figuring out the issue. The issue is in the opencsd, where it doesn't seem to support multiple streams when the formatter is not enabled. . Note:Our Silicon has formatter disabled and we already had changes in perf tool to take care of the formatter status. The below hack helped. diff --git a/decoder/source/ocsd_dcd_tree.cpp b/decoder/source/ocsd_dcd_tree.cpp index be15e36..0210dec 100644 --- a/decoder/source/ocsd_dcd_tree.cpp +++ b/decoder/source/ocsd_dcd_tree.cpp @@ -401,7 +401,7 @@ ocsd_err_t DecodeTree::createDecoder(const std::string &decoderName, const int c int crtFlags = createFlags; uint8_t CSID = 0; // default for single stream decoder (no deformatter) - we ignore the ID - if(usingFormatter()) + //if(usingFormatter()) { CSID = pConfig->getTraceID(); crtFlags |= OCSD_CREATE_FLG_INST_ID; Not sure if this is the right fix though. This is how i tested, 1. # taskset 0x2 ./perf record -e cs_etm//u -F 10 --per-thread ping -c 30 127.0.0.1 2. # Ctrl-Z // Put the process in background 3. # taskset -p 0x4 // Move the ping process to core 2 4. # fg // Get the process to foreground 5. ./perf report snip ... # Samples: 66K of event 'branches:uH' # Event count (approx.): 66953 # # Children Self Command Shared Object Symbol # ........ ........ ....... ..................... ........................................ # 15.94% 15.94% ping ld-2.31.so [.] _dl_lookup_symbol_x 14.93% 14.93% ping ld-2.31.so [.] do_lookup_x 10.68% 10.68% ping libc-2.31.so [.] _dl_addr 9.87% 9.87% ping ld-2.31.so [.] _dl_relocate_object 6.75% 6.75% ping ld-2.31.so [.] strcmp 3.62% 3.62% ping ld-2.31.so [.] check_match 2.72% 2.72% ping libc-2.31.so [.] __vfprintf_internal 1.90% 1.90% ping libc-2.31.so [.] _int_malloc 1.29% 1.29% ping libc-2.31.so [.] getenv 1.28% 1.28% ping libc-2.31.so [.] strcmp 1.17% 1.17% ping libc-2.31.so [.] _IO_file_xsputn@@GLIBC_2.17 1.16% 1.16% ping ld-2.31.so [.] _dl_name_match_p snip ... Also i could verify using prints in the tmc-etr-driver that the trace buffer gets reused across cores as well. > Also, what is > > perf --version ? perf version 5.9.0-rc5 > > > > # To display the perf.data header info, please use --header/--header-only option > > > > ============================================================================ > > > > Appreciate your help on getting some debug hints on what is going wrong. > > > > > > One strange thing noted here is sys_perf_event_open, passing cpu = -1 > > and pid = -1, > > which doesnt appear to be valid as per tools/perf/design.txt > > I see that on my Juno, but it still works. I believe that is for the > generic PMU (pmu.type == 1) and not the coresight PMU, which I believe > is (type == 8) in your case (the first event). > > Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel