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=-8.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 32747C2D0A3 for ; Thu, 12 Nov 2020 09:22:15 +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 9BA7521D40 for ; Thu, 12 Nov 2020 09:22:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UyzrkaI8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BA7521D40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oNA2VLaJ0wxosteSD2oJRLQGZOiEUatkzQZlFCRGEd4=; b=UyzrkaI8NWbFOUekDuAMed8dH ztFVHIEjtEvholn09KHCIlq0GspbEX/t4I/CTlR68FIaggwq4i2yZtvOfn1wOaexYotGt7TPbbZKo /rJPCa1whnkEibbbvTEYb710u4VTCiOJm+A3ObjDh/ZPIZZxCRJA4uzX5VnhbCwGHGo27fY1OfGtI +bqCL2NMzIRmKVMCRlJZTqbeMYarxwkSok9nilneVVElNbqriAWUI/2z2jSXiZ1mSMCn1aUzzStwG mvtgGowsTcZOWN4LgaCbGMbV6pY1MBPBHHlLbcqeExw2nB3W9YFVVvjiQqAVgRxEEOBIGvI+ByGJZ rT590/78w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kd8me-0002ox-FB; Thu, 12 Nov 2020 09:20:48 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kd8mb-0002oB-El for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2020 09:20:46 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C0827139F; Thu, 12 Nov 2020 01:20:41 -0800 (PST) Received: from [10.57.23.123] (unknown [10.57.23.123]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6AF6D3F73C; Thu, 12 Nov 2020 01:20:40 -0800 (PST) Subject: Re: [PATCH v4 0/2] Make sysFS functional on topologies with per core sink To: Linu Cherian References: <20200904024106.21478-1-lcherian@marvell.com> <2bd65f2d-5660-10b3-f51f-448221d78d3d@arm.com> From: Suzuki K Poulose Message-ID: Date: Thu, 12 Nov 2020 09:20:33 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_042045_600406_86700861 X-CRM114-Status: GOOD ( 25.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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/12/20 8:57 AM, Linu Cherian wrote: > 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, >>> >> ... >> .... >>> # ./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. That may work for you, but would break the existing platforms and the drivers which enable formatting by default. We need a way to address this in the perf side. This would be needed for the ETE/TRBE trace scenario as well, where the formatting is not supported by TRBE. > > 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. Cool ! So please could you test the newer version of this patch (not functionally different, but slightly modified code) and add a Tested-by if you are happy with it ? https://lore.kernel.org/linux-arm-kernel/1605012309-24812-3-git-send-email-anshuman.khandual@arm.com/ Cheers Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel