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.2 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,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 C88BFC433DB for ; Wed, 13 Jan 2021 15:31:00 +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 7BC1323102 for ; Wed, 13 Jan 2021 15:31:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BC1323102 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: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=R/Ar//kwugSUv/D4CnCVvVPGzvAq7qSeaXiv9QwEOTQ=; b=CKhAeDaUZ88JevW2EL6q7iYBo lnKDof0VDOq8u/9+KEq6jn3ZEBoQJNuRnLlpfr81wZaURTO9kv/shRXgkbEA6NXVXtEEXJIHGAcz7 6MxQP8sAlMhRftM3kjrPFwidLpv91p8Gm0wy19ImFtyx6LR+9K0y0sxnFucrE66RhzcOn3YGegMBk dtB62XDUsS53YViCSLYbtLw3zT6FQv9Pc+a3Z2/cR5F8uNob7ORTIoCwO97pwjVs3yfmCroOQfiBB K0d2tdXXY1m2+99fWn9+MpxYOtyp+egOeOT0Vu+pIY7TUJD7L9ddYo0d16rW/eGnthrlRT9kvC9+c nlqhbADnA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzi5Q-0003Pk-Oc; Wed, 13 Jan 2021 15:29:28 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzi4n-00033L-BH for linux-arm-kernel@lists.infradead.org; Wed, 13 Jan 2021 15:28:53 +0000 Received: by mail-pf1-x42a.google.com with SMTP id b3so1432015pft.3 for ; Wed, 13 Jan 2021 07:28:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GhcOMFmOM/RKIOW5vRHyLurCFrc+tlmfKL15joGlg34=; b=sPtiLxZNBTTenaR7mwVl0MyD6kAaZQfzTjNOakLKHl4HtMbRx1VBJ9ihGyqPLE5a99 qb/VhyXa/aAKXDbHv6wIQuGG5AHm8dP9KGz7IaS3dQDwLBLjRpCIF9oSozqfGmFHQQco 6vGy1VdjlLhyBAMP/wwWCCcDnD21BbQ1KPi07E/gXADszyD2gMBpUi44W/cwaeBTa6oy Hp7XcEf77KfHrDTBpnQ85U4Qym+Vrp4wPpiYhUTmj/3DPvq7qiJQK9CC6ye9k34inbuE /G0gIJ6dbMtTzr8+BIiWNPLLW/pBqHIUT+HQ873nkO5oXyqkPMqhfGjOu4HqBy/mGnCp esRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GhcOMFmOM/RKIOW5vRHyLurCFrc+tlmfKL15joGlg34=; b=a9/HS/QeQkM8kWMjrkAUnyk5UR/UFZSX6kzI6xypRRQIjOmL/U2GQdOZxExQ1mSOhg FpWyhEcRJOYCGFv3iYpnzYIONcIgnBHu0IDqZyrmWTLpTG543ZF8dC9gedBWxJhTyGWy r8SIHdrMn260Z811uvLDgfSzLPZRKhAG55l9wtfNmS13IVGyPAH0mTM55JYCd1QiZH6Z ah7N0iX8Hb1Pz1eMYY7GvGjAUPLIGmkRX88iUECJBdMNUbG4XyXXLS35XLqNTaHXHfOs N2Aa+wVPECPzg3Sb5jq7LrJbze5yRWypgLaKmNAlA++ZiizQlQ3OzwCufmX0THhrI2Ww qjXA== X-Gm-Message-State: AOAM531gVBml/aYSN/gC1e9Z9EqkKOmutNb5KH0KxAR1/kCvJoV84fI0 cQHtOFfVHmMMDjcYH7LdhKk= X-Google-Smtp-Source: ABdhPJwVpkE6Lf2phToeSG3RaUKOQypX+Zv0ktZrvTylVbM7d9sqzCQlWNZavVMR0J5vBD9u6Uf6LQ== X-Received: by 2002:a63:1220:: with SMTP id h32mr2543814pgl.309.1610551724655; Wed, 13 Jan 2021 07:28:44 -0800 (PST) Received: from [10.0.2.15] ([122.167.95.42]) by smtp.gmail.com with ESMTPSA id x15sm2841980pfn.118.2021.01.13.07.28.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Jan 2021 07:28:44 -0800 (PST) Subject: Re: Reading and Decoding Data From ETB Buffer To: Mike Leach , Mathieu Poirier References: From: Ajay Bharadwaj Message-ID: <2bc056c6-0124-bbe7-5e1b-8ef5edf877a2@gmail.com> Date: Wed, 13 Jan 2021 20:58:38 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210113_102849_512321_1217E6EB X-CRM114-Status: GOOD ( 16.27 ) 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: "Suzuki K. Poulose" , Alexander Shishkin , Coresight ML , Leo Yan , Robert Walker , Pratik Patel , linux-arm-kernel 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 Mike, Thanks for the quick reply! On 12/01/21 11:37 pm, Mike Leach wrote: [...] >>> >>> OpenCSD Output: >>> Trace Packet Lister: CS Decode library testing >>> ----------------------------------------------- >>> >>> ** Library Version : 0.14.4 >>> >>> Test Command Line:- >>> ./tests/bin/linux64/dbg/trc_pkt_lister -ss_dir >>> tests/snapshots/stm_only/ -src_name ETB_1 >>> >>> Trace Packet Lister : reading snapshot from path tests/snapshots/stm_only/ >>> Using ETB_1 as trace source >>> Trace Packet Lister : Protocol printer STM on Trace ID 0x1 >>> ID:1 END OF TRACE DATA >>> Trace Packet Lister : Trace buffer done, processed 16384 bytes. >>> > > In general, if the trc_pkt_lister program doesn't find trace then > there is none for the ID you have assigned to the STM in the snapshot > .ini files. > Try adding -o_raw_unpacked to your command line. Your will then see > some output of raw bytes and associated trace ID as below.. > > Frame Data; Index 32704; ID_DATA[0x20]; 83 01 6f ff ff ff 0c 01 06 > 10 7b 2b 6c ff The problem was that the ETB buffer was overflowing and the initial portion of the buffer was being overwritten. This was happening because as soon as STM Source Console was enabled, the backlog of kernel messages was being written to the STM_Console and flowing down to the ETB. Reading from the ETB, and then writing to the STM_Console and reading from the ETB again leads to this output while decoding: Trace Packet Lister: CS Decode library testing ----------------------------------------------- ** Library Version : 0.14.4 Test Command Line:- ./tests/bin/linux64/dbg/trc_pkt_lister -ss_dir tests/snapshots/stm_only/ -src_name ETB_1 Trace Packet Lister : reading snapshot from path tests/snapshots/stm_only/ Using ETB_1 as trace source Trace Packet Lister : Protocol printer STM on Trace ID 0x1 Idx:0; ID:1; NOTSYNC:STM not synchronised Idx:16; ID:1; NOTSYNC:STM not synchronised Idx:32; ID:1; NOTSYNC:STM not synchronised Idx:48; ID:1; NOTSYNC:STM not synchronised Idx:64; ID:1; NOTSYNC:STM not synchronised Idx:80; ID:1; NOTSYNC:STM not synchronised Idx:96; ID:1; NOTSYNC:STM not synchronised Idx:112; ID:1; NOTSYNC:STM not synchronised ID:1 END OF TRACE DATA Trace Packet Lister : Trace buffer done, processed 16384 bytes. Is there any way to get around this and force the STM to send a synchronization packet again without re-enabling the STM? Is there already another tool or some setting for the Trace Packet Lister that reverses the data and outputs it in a more human readable format so that the decoded data is shown in the same way as the data being written to the STM? This would make it much easier to use and parse ftrace data, which is my end goal. Writing a script to do this would be simple but a well maintained tool would be much better. Input Data: [ 55.991806] printk: console [stm_console0] enabled [ 70.452733] AAAAAAAAAAAAAA This what the output currently looks like: Trace Packet Lister: CS Decode library testing ----------------------------------------------- ** Library Version : 0.14.4 Test Command Line:- ./tests/bin/linux64/dbg/trc_pkt_lister -ss_dir tests/snapshots/stm_only/ -src_name ETB_1 Trace Packet Lister : reading snapshot from path tests/snapshots/stm_only/ Using ETB_1 as trace source Trace Packet Lister : Protocol printer STM on Trace ID 0x1 Idx:0; ID:1; ASYNC:Alignment synchronisation packet Idx:11; ID:1; VERSION:Version packet; Ver=3 Idx:13; ID:1; FREQ:Frequency packet; Freq=0Hz Idx:21; ID:1; M8:Set current master; Master=0x44 Idx:22; ID:1; D64TS:64 bit data + timestamp; Data=0x392e35352020205b; TS=0x00000002E5004F22 ~[0x2E5004F22] Idx:41; ID:1; D64:64 bit data; Data=0x70205d3630383139 Idx:50; ID:1; D64:64 bit data; Data=0x63203a6b746e6972 Idx:59; ID:1; D64:64 bit data; Data=0x5b20656c6f736e6f Idx:68; ID:1; D64:64 bit data; Data=0x736e6f635f6d7473 Idx:77; ID:1; D64:64 bit data; Data=0x6e65205d30656c6f Idx:86; ID:1; D32:32 bit data; Data=0x656c6261 Idx:91; ID:1; D16:16 bit data; Data=0x0a64 Idx:93; ID:1; FLAG:Flag packet Idx:94; ID:1; M8:Set current master; Master=0x43 Idx:97; ID:1; D64TS:64 bit data + timestamp; Data=0x342e30372020205b; TS=0x00000003915D477A ~[0x3915D477A] Idx:113; ID:1; D64:64 bit data; Data=0x41205d3333373235 Idx:122; ID:1; D64:64 bit data; Data=0x4141414141414141 Idx:131; ID:1; D32:32 bit data; Data=0x41414141 Idx:136; ID:1; D16:16 bit data; Data=0x0a41 Idx:138; ID:1; FLAG:Flag packet ID:1 END OF TRACE DATA Trace Packet Lister : Trace buffer done, processed 16384 bytes. Regards, Ajay _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel