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=-3.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 E7DD3C388F7 for ; Tue, 10 Nov 2020 12:58:21 +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 6B49320679 for ; Tue, 10 Nov 2020 12:58:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="1jFrg2s0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VZyoYZEr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B49320679 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=qrHIPC6CEcMVWCT9W7QN2hH1g9/keOZ3X1YZnXEa/Fc=; b=1jFrg2s0On0Iz/82pA/C1k3Mb UedPyK3R1P/aPnGO5KdB+iNxX3+oTNv5+Xfvg6kKjlMFvl0hSszoVX2vbLLmTlymYDl/Qm/9wWJzM 7yzj6tZethHfFdNUB7EZd8d7SobHjzSt6rTauHUWHUHjvL7FyivH/vjzfGBfnLTSf4ONuqVPK1gDl FUMkS7OPilA34dAsFHhj6KGtVzewaxd346DmdVcwQiWElhygSLDnGEYIpvV2xAXqcstdC68JZEnR7 ytldTJJAEvl3KV0SbQLq04NjiPFDuRmuaV5QeBfkO0LNXFRnhUTYNtFkfQGeptviU8Fc7WQcBq+IX Fw1PMvOaA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTDe-0001GQ-MQ; Tue, 10 Nov 2020 12:57:54 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTDb-0001FJ-I1 for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 12:57:52 +0000 Received: by mail-lf1-x134.google.com with SMTP id i6so17379776lfd.1 for ; Tue, 10 Nov 2020 04:57:46 -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=z0OOuYJsoxWqvcFQaKxIrLPqGa8fo9pufZN/8vupBh8=; b=VZyoYZErjrPcoSpB7TOt3iS8zo625qMo7K9WSqyHvIoqWkP3ym9oFeHVZe9yiYbuNY bt8C1QoFWRaFXxg+Iq6joRd2YOFbopLFXcXecL/84hd5QUhF6AeF/28nHpxoBRNWE41C OkabZDjYu8VPpWkebColh10Lz51m0mO6ZNn6wv1QD1TTaC3OK94/7iuvMRL6gKqrn+qu qs5cGMuC1FPfqKvhAeuzaJsowYGcJZZT9Kx78Nr9BjAZ5qIoAtAMJYIzVvVhDcu+Zh3p fmLkC/qcNQotkaZWE87tACvwSL08rpWBkwKinq4wjssy0cshCEKu7cGmN9D3r/CpmdCJ b1ew== 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=z0OOuYJsoxWqvcFQaKxIrLPqGa8fo9pufZN/8vupBh8=; b=VARhAFLDvZDVIXHDdpZHaLyzF1DvSONEVJqreEE5NuK/ug0TTJrS7CAr7TsaLKlC3q +vNeBlVljSg1mBsp3wYVDK7kNiRSWcLLT1s9fstePtgBpEfVAEE0jDoVuUDUxnrp2NYo 6I48vQ4BaZHBfTwO+VnBfz3bue8Xr5Txx7zrD/XQ76j+DhzbHaYm3zdHOHG+EfeaQO8u xmDMDn3zxdqfJa4C3Mf2Qtg4JzFd3TBChK1VEaw0z1XAw8JB/63T10yRl2lEE+Dtqxzj e9ES8x0YZ+gknlifXo5Tlzsu60hB9LxVtc+iVXZeEjttwmbMrBoKbdFaIQ/blsKZn8AI sJqQ== X-Gm-Message-State: AOAM530Ls4Bsd66a7g0y91/jAR46RNbrbwWu6YZIkuIOo/Fhpii5fL5Q tZQy8hhSuoasocwELum/KEqn8hhGFaqL9QetrrmS6HSXwBQ= X-Google-Smtp-Source: ABdhPJwLrYBIWYHwMJQOgnd7M1HWZuFN3I+Q4cubsw9nqyZoVnVJ3K7E0Rt9d+slujHMZP4Mvg9Bet3je+AjgoGD6OA= X-Received: by 2002:a05:6512:3708:: with SMTP id z8mr8263266lfr.376.1605013065432; Tue, 10 Nov 2020 04:57:45 -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: Tue, 10 Nov 2020 18:27:33 +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-20201110_075751_660158_A2A59457 X-CRM114-Status: GOOD ( 38.60 ) 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 Sat, Nov 7, 2020 at 11:13 AM Linu Cherian wrote: > > Hi Suzuki, > > On Tue, Oct 27, 2020 at 6:43 PM Linu Cherian wrote: > > > > Hi Suzuki, > > > > > > On Mon, Oct 26, 2020 at 11:47 PM Suzuki K Poulose > > wrote: > > > > > > Hi Linu, > > > > > > Thanks for the feedback. My responses inline. > > > > > > On 10/26/20 4:33 AM, Linu Cherian wrote: > > > > Hi Suzuki, > > > > > > > > On Mon, Oct 5, 2020 at 4:52 PM Suzuki K Poulose wrote: > > > >> > > > >> Hi Linu, > > > >> > > > >> On 09/04/2020 03:41 AM, Linu Cherian wrote: > > > >>> This patch series tries to fix the sysfs breakage on topologies > > > >>> with per core sink. > > > >>> > > > >>> Changes since v3: > > > >>> - References to coresight_get_enabled_sink in perf interface > > > >>> has been removed and marked deprecated as a new patch. > > > >>> - To avoid changes to coresight_find_sink for ease of maintenance, > > > >>> search function specific to sysfs usage has been added. > > > >>> - Sysfs being the only user for coresight_get_enabled sink, > > > >>> reset option is removed as well. > > > >> > > > >> Have you tried running perf with --per-thread option ? I believe > > > >> this will be impacted as well, as we choose a single sink at the > > > >> moment and this may not be reachable from the other CPUs, where > > > >> the event may be scheduled. Eventually loosing trace for the > > > >> duration where the task is scheduled on a different CPU. > > > >> > > > >> Please could you try this patch and see if helps ? I have lightly > > > >> tested this on a fast model. > > > > > > > > We are seeing some issues while testing with this patch. > > > > The issue is that, always buffer allocation for the sink happens to be on the > > > > first core in cpu mask and this doesn't match with the core on which > > > > event is started. Please see below for additional comments. > > > > > > Please could you clarify the "issues" ? How is the buffer allocation > > > a problem ? > > > > 1. Just realized that the issue that we are seeing with this patch is something > > specific to our test setup, since we had some custom patches that was required > > for supporting the secure trace buffer configuration for our silicon. > > > > And to be specific, our changeset was relying on the drvdata->etr_buf at the > > time of tmc_etr_sync_perf_buffer. > > > > In per core case during buffer allocation, > > the sink chosen is always for the first core, core 0. > > Let's consider the event started on say, core 4. > > So w.r.t drvdata of tmc_etr4, > > drvdata->etr_buf would get initialized while starting the event. > > And w.r.t drvdata of tmc_etr0, > > drvdata->etr_buf would be NULL here and our custom changeset > > was expecting to be initialized with the etr_buf. > > > > So will try to rebase our patches accordingly and test this again. > > > > 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 [ 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 # 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 Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel