From patchwork Fri Nov 6 09:48:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 11886679 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 CE284C388F2 for ; Fri, 6 Nov 2020 09:55:11 +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 4BED620B80 for ; Fri, 6 Nov 2020 09:55:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OlDl+IfL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="o/zsdk0M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BED620B80 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wIhDKJ6UZpvMZtoiyP+8q0pft3XnZwiz/c69xLbwT3M=; b=OlDl+IfLmvn6y9ZU4AsLL6hiHQ nl22F82m9KK5MKZuUQ1Nwmqlq1f1V9DB+UpmTDb/4vXBlrFK5iK7EgnOztYl8QpSpGt1cymEhytZ9 eKpuYTSyMBDgyy/VrOBgM9/Hm7N57+nIVSz0692d4cicS4GXxAqddocEEELcLESRDRvfOvN6U9/It CbFXX72CDVADQC2PkwCRlhWLLWrYuRA5YhqEXarNUUxchUb+7/Xx4npkhBYUlZNRpookmhjWPai/J 9oa5iUZejo6bfizAanOrkbdaw/f2bbhrFKqlKMk0BpulvpA6jtaTGkQYKqSwkSInzsFsAsBwwZ78j Uwnb26PA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kayQZ-0000ZM-Ej; Fri, 06 Nov 2020 09:53:03 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kayNi-0007aa-RN for linux-arm-kernel@lists.infradead.org; Fri, 06 Nov 2020 09:50:08 +0000 Received: by mail-pf1-x442.google.com with SMTP id a18so644697pfl.3 for ; Fri, 06 Nov 2020 01:50:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ILWWMC+AJIBjzFX4DDF2uqdjSVU6HVG1cDD622d/Z14=; b=o/zsdk0MYdA3+OjXAHB4Q5EolCthoG0Uc1Tm9hDPo81yAL86/NGa1bQBcmJt3vClKS sfJHWhOwtj036yMY6FB+9Yx1SUwKe+acy7GPAtvhsXRs/byQNu6XsA8Xk6JGASTETWoH 9tg1ykxHTPkiJD+eCk7JwFt+UKlROYKRgviaem9/ezEOBAVeUsJv8GF92epkvSj2rZIJ P3ZD10OO3P7fsqmu0DOVPXy+IVQlOIWFi/g6Tvmwc5/rghaVSV6aFvBtZXZ0AzHWXyDD h0buN6x0igG58B9280pvMNqxfDueh6CocLFWCeUdD+fCEp8i7DoobCEFLs5HalPIDa7q Qxew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ILWWMC+AJIBjzFX4DDF2uqdjSVU6HVG1cDD622d/Z14=; b=o2ADtJKbjZYjZDq+XUbITC9koelLLZqq7luYZAcnl540X/ZphSr1MVD1Vgq9SVVmOA PJcB7YSMVicUMjuvGp8ldxzz2bDD4cErjHiLav8GKeWxeHk9oUBmLuBkC1UdcW5tEZJy 1KtCwlecelBRbRDYRGzyvw09Nfk4bL3AnaFVN9qmBMj+tZG5UntsZj+J9K48d8ph4qTE lJg40jhNLKL85OGGiX1vqnn6SQaDWgA4sZHNLJde+tUbf/+k8VkSdpxkmTAlXa9jraQJ c09HT48TIvvkjsVz+SSI28ZK/J1WbP6p0Vkg5KLMNFRhktYA2WW/KD3C/aNfjowTts3V Oz3w== X-Gm-Message-State: AOAM530rVzgwel7ox087VgUIha1BsQkjccRgJ+p3xY25G1zMCrTVV5Fq jUjiPvlpVk2Vu9MpNUKBaOsuHg== X-Google-Smtp-Source: ABdhPJyFb/tZZFeyGSfVT09TIevO/mVqY52Rn1dBHNCV4+JW0BQ32q72IJDGavChxDl8bQVZu2OWWw== X-Received: by 2002:a17:90a:ce8c:: with SMTP id g12mr1598141pju.181.1604656204657; Fri, 06 Nov 2020 01:50:04 -0800 (PST) Received: from localhost ([2400:8904::f03c:91ff:fe8a:adf7]) by smtp.gmail.com with ESMTPSA id s18sm1585697pfc.5.2020.11.06.01.50.03 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Nov 2020 01:50:04 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , Jiri Olsa , Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Namhyung Kim , John Garry , Will Deacon , Mathieu Poirier , Adrian Hunter , Andi Kleen , Kemeng Shi , Sergey Senozhatsky , Al Grant , James Clark , Wei Li , Andre Przywara , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 8/9] perf c2c: Support AUX trace Date: Fri, 6 Nov 2020 17:48:52 +0800 Message-Id: <20201106094853.21082-9-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201106094853.21082-1-leo.yan@linaro.org> References: <20201106094853.21082-1-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201106_045006_942743_A768AFD3 X-CRM114-Status: GOOD ( 15.99 ) 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: Leo Yan MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch adds the AUX callbacks in session structure, so support AUX trace for "perf c2c" tool; make itrace memory event as default for "perf c2c", this tells the AUX trace decoder to synthesize samples and can be used for statistics. Signed-off-by: Leo Yan --- tools/perf/builtin-c2c.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 98ae33eac6cc..c5babeaa3b38 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -369,6 +369,10 @@ static struct perf_c2c c2c = { .exit = perf_event__process_exit, .fork = perf_event__process_fork, .lost = perf_event__process_lost, + .attr = perf_event__process_attr, + .auxtrace_info = perf_event__process_auxtrace_info, + .auxtrace = perf_event__process_auxtrace, + .auxtrace_error = perf_event__process_auxtrace_error, .ordered_events = true, .ordering_requires_timestamps = true, }, @@ -2678,6 +2682,12 @@ static int setup_coalesce(const char *coalesce, bool no_source) static int perf_c2c__report(int argc, const char **argv) { + struct itrace_synth_opts itrace_synth_opts = { + .set = true, + .mem = true, /* Only enable memory event */ + .default_no_sample = true, + }; + struct perf_session *session; struct ui_progress prog; struct perf_data data = { @@ -2757,6 +2767,8 @@ static int perf_c2c__report(int argc, const char **argv) goto out; } + session->itrace_synth_opts = &itrace_synth_opts; + err = setup_nodes(session); if (err) { pr_err("Failed setup nodes\n");