From patchwork Fri Jul 12 10:20:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13731584 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9816BC2BD09 for ; Fri, 12 Jul 2024 10:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3dUxw4pnzTq6V22lhZXyELBpDIT+OtfcjZAN4tSNlkQ=; b=ZBZ3sp0boHox57yoIvFyf3rRyg hhMSIVJ0wRd+v6kRmPOa7333BK5LOy4nu+u9N9RQ/FFdusJ2j/Jh9/Cn4pcJSLg0zRHDIUhseVgLe TJ0Yyisy2u4RrVLEIKux2lPSxlzL7EF/bQAlY2qEz6gglnqKyxwZo36ZJ5R4FcPfNQ64zYCtj1QA1 eaxtoyFUmXY9K1sp9o+MnMAxbGo0Vqz7sTZzpEWXrSjeRKzw6lkVKYgPoKrBRbeCSABMURUMBe/IC jCAYzQvJ1rzk+WYhO/X/jHTC2pF425kqsDnbUbjIYBzy1EEvEFFX5s2CTkz6E7olbiXa6mFVep5oF ZaNl6Atw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSDS7-0000000HI3j-3t8e; Fri, 12 Jul 2024 10:24:36 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSDQI-0000000HH8I-3mDe for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 10:22:44 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-367ac08f80fso956900f8f.1 for ; Fri, 12 Jul 2024 03:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720779761; x=1721384561; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3dUxw4pnzTq6V22lhZXyELBpDIT+OtfcjZAN4tSNlkQ=; b=NpMXNS2TZ0pLHBbyIB81Yam1loIUnXoAuzerOJnFyldvbFF3PSbfHdvJxhGIKb5sIc x6Q882/JSqlRjq6o+FEVjp1EioMvyjYlLIEcKN3MdkIDcJCs61JBDgIoDRV98lmqIZoE 2W8MOV/ftLfvnJEyVElJuh3byGHgKawzDQ4UlG05cjZyfwJvxCeDBIZJ7g2i6dAA8pAK YV1dt/ezkwCeQHCy0KUspF3NvZjtq5VwAsj8pFVszfcOJWe3nMEWuVmFjKrGg9E5PywY maclPSgPAEGKRxGlcnmKZ9Lqit7HMyHdtOnPZQQMLznzmr81GgK4cqj0AueDFWDNOrSt ilEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720779761; x=1721384561; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3dUxw4pnzTq6V22lhZXyELBpDIT+OtfcjZAN4tSNlkQ=; b=hbQybGgfszsgofr+RFaWt5yCGGNDZiibsBOyqO4TlB3GaNfaFNcipaK89ohAuxd50R XWEGjuR/tVK44JTg5xOWA6aUBsNqAjOCt2A2mv5zJJFWP1aBZTsnYLVSOwmkNnRo5DO+ pO645K3NO5zj8w6YfWe9USBlZEaXVRvey1QniW9EugZ4J6NkjEba+hA4M92RpGhG5IN8 ktO6JT6S5NEJfqYaoRU/Z3BudYuKQuRB5AFkOH91ic2ilpGzkJiKQsIV7nXzlkDKntnL CCFr6X1hcroXQ293FAGSb2xLtgeGx/13mbefzEi51lWvbRy0Ch/73lzOO0tu+hyTnMWt Tf9A== X-Forwarded-Encrypted: i=1; AJvYcCUkA1dCxecabx0d+ny0b58J0xUwZCyKJrqf6UzSwyYHamyEgNA8DpclBcTf6ejOHBgEkqmqV6rLqY4/0NPJCbGkTdGhilSJCcyTwvvllrkm46N24Gg= X-Gm-Message-State: AOJu0YxJB29I5cm4EjXFDdcrk39uqpUwyaqmISRcrNq9ECzqEP2JEVgR qo3UNskTgMBsJOl3dAnFY9ZAbKcgQbvybLi41ZHdXklJmA6UBoM32HO4WxItWx0= X-Google-Smtp-Source: AGHT+IF+R3RQarQUJDVqwDOdNbdiQNMbxNXEfqhZWKHIvM9InYkmtV7hlxj0r3Fieyfyj3lD/5Omtw== X-Received: by 2002:a05:6000:1b06:b0:367:96d6:4c2d with SMTP id ffacd0b85a97d-367cea6b830mr7924712f8f.25.1720779761602; Fri, 12 Jul 2024 03:22:41 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367cde89164sm9911058f8f.63.2024.07.12.03.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 03:22:41 -0700 (PDT) From: James Clark To: coresight@lists.linaro.org, suzuki.poulose@arm.com, gankulkarni@os.amperecomputing.com, mike.leach@linaro.org, leo.yan@linux.dev, anshuman.khandual@arm.com Cc: James Clark , James Clark , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Jiri Olsa , Ian Rogers , Adrian Hunter , "Liang, Kan" , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-perf-users@vger.kernel.org Subject: [PATCH v5 07/17] perf: cs-etm: Print queue number in raw trace dump Date: Fri, 12 Jul 2024 11:20:16 +0100 Message-Id: <20240712102029.3697965-8-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240712102029.3697965-1-james.clark@linaro.org> References: <20240712102029.3697965-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240712_032242_973426_852F87B8 X-CRM114-Status: GOOD ( 16.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: James Clark Now that we have overlapping trace IDs it's also useful to know what the queue number is to be able to distinguish the source of the trace so print it inline. Signed-off-by: James Clark Signed-off-by: James Clark --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 4 ++-- tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 2 +- tools/perf/util/cs-etm.c | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c index d49c3e9c7c21..b78ef0262135 100644 --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c @@ -41,7 +41,7 @@ const u32 INSTR_PER_NS = 10; struct cs_etm_decoder { void *data; - void (*packet_printer)(const char *msg); + void (*packet_printer)(const char *msg, void *data); bool suppress_printing; dcd_tree_handle_t dcd_tree; cs_etm_mem_cb_type mem_access; @@ -202,7 +202,7 @@ static void cs_etm_decoder__print_str_cb(const void *p_context, const struct cs_etm_decoder *decoder = p_context; if (p_context && str_len && !decoder->suppress_printing) - decoder->packet_printer(msg); + decoder->packet_printer(msg, decoder->data); } static int diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h index 272c2efe78ee..12c782fa6db2 100644 --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h @@ -60,7 +60,7 @@ struct cs_etm_trace_params { struct cs_etm_decoder_params { int operation; - void (*packet_printer)(const char *msg); + void (*packet_printer)(const char *msg, void *data); cs_etm_mem_cb_type mem_acc_cb; bool formatted; bool fsyncs; diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 87e983da19be..49fadf46f42b 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -762,15 +762,16 @@ static void cs_etm__packet_swap(struct cs_etm_auxtrace *etm, } } -static void cs_etm__packet_dump(const char *pkt_string) +static void cs_etm__packet_dump(const char *pkt_string, void *data) { const char *color = PERF_COLOR_BLUE; int len = strlen(pkt_string); + struct cs_etm_queue *etmq = data; if (len && (pkt_string[len-1] == '\n')) - color_fprintf(stdout, color, " %s", pkt_string); + color_fprintf(stdout, color, " Qnr:%d; %s", etmq->queue_nr, pkt_string); else - color_fprintf(stdout, color, " %s\n", pkt_string); + color_fprintf(stdout, color, " Qnr:%d; %s\n", etmq->queue_nr, pkt_string); fflush(stdout); }