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=-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 239B0C388F2 for ; Fri, 6 Nov 2020 09:51:55 +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 9DE502087E for ; Fri, 6 Nov 2020 09:51:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dhPc5vV9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qagIXdRG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DE502087E 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=hM75vlSHio0f0hWRK0+CRY5yAuKpqFyBBKew1hkXi4I=; b=dhPc5vV9Y4ZsYeqgIZDRe6JQMp VZaWgAM9FtXJbN5ft9kwTZbfsTGAXG6PZz6cCYkE3Cqql6tf5/zdaIqKzzSkwDAnbCh6R0Wk50PRj /xVgxlte4UmLaDCCVRAtpG8AQQEMuxbBCY4iS3GJlUj5Vp/RXbHvAk2lOWD1oX2ZWfKfmPOfdc1yF FoEWMVit3U5MKtNeu9t2M38EMjc+m7SNzrM1jvHZio65x0XgxhBiDRvsbZEu7s76fIRkghqgZ4ErL wTNRZo/xUtYP7E1WL+NBztUfGFFvnyf7hYKFYPXf676ZSrzxVBG8zEEf5fvkgZiPlOyRYoAo02s8e 30Mrrsgg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kayOu-0008Dy-TJ; Fri, 06 Nov 2020 09:51:20 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kayNR-0007QP-Gl for linux-arm-kernel@lists.infradead.org; Fri, 06 Nov 2020 09:49:51 +0000 Received: by mail-pg1-x542.google.com with SMTP id h6so540670pgk.4 for ; Fri, 06 Nov 2020 01:49:48 -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=LYurlota429k+S26ab5934uwHlC+pF/vMcIbnSJ/V9o=; b=qagIXdRGk0Gmhr9PFGLytsMpJ6MiBHp+xj3CZSq0X36y7BrRRE/WL9JjhmvSHfsI7E Ruo7NHtohS7VNOXD9PDQIO9oZdo9Ow4q58Fv9SWL1s8PGex1gvhC7xF08vV/kFTc3eEF koH1cJr5IFatibk70QhtI0tl6AFyl3tMFGCAABL+HSesli6KrYdqectKDCe3cpV1rM6K fEIdc1LVqsYQcELYIjyj7AXPVwQEmvggXtPskfX2vUuIPrwD7NDS/fPnUNWpjxDfXkXv D0JIW8TGyPp3n9z2p5l59nsJeQl8+6JV3dz5EuQh6pfOCtIqCXr0TOUxS+tieXuf/kTI zjpQ== 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=LYurlota429k+S26ab5934uwHlC+pF/vMcIbnSJ/V9o=; b=cCnIBq0/75GXpI4nNPrWo+RIcZkTsbOZvHrHuuVdJqYduqMg9q7qGWVWNxxcXWNKPf ToKubAvP1kmldjaWc+C2bhOyMcsdy9vetH162c7s/gxiYikPXgQl+IvMQF+T1PYQsYbc N37g3VumFcid7iVhk8Cbb4WQvnPyeD5nkxiDUV8mtdbzdU0P/wQ7cYt+0plKTjWUwZbO pKejdgoDPqGccgrdYHeKanSA5kqS5zT3HZnmvUXEBNNYP9rhaLGyUNP2WCFF/oz1k6yM UMHFe2OuuMcWbozAs83ouaDWBnwKXEjmuFt0gxxYEkMg8A+yeKNvsm0UYhh5ccym8KKe nmQA== X-Gm-Message-State: AOAM5336GNbjEJ5oP4u8X+Rqh6M5qKvXeYoPrvolDJf7qnS6GN8ProDM nZsblrPvZDiuIomzEAxD6ZqsZQ== X-Google-Smtp-Source: ABdhPJy3smMYOtATZcLboJdt62vLjlIt4Z1DwdMeYX/nzaKvREMsTC/fo3oENctsIYtIEJnzJYnt2Q== X-Received: by 2002:a63:de07:: with SMTP id f7mr1036356pgg.27.1604656186608; Fri, 06 Nov 2020 01:49:46 -0800 (PST) Received: from localhost ([2400:8904::f03c:91ff:fe8a:adf7]) by smtp.gmail.com with ESMTPSA id o10sm1049774pgp.16.2020.11.06.01.49.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Nov 2020 01:49:46 -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 5/9] perf mem: Only initialize memory event for recording Date: Fri, 6 Nov 2020 17:48:49 +0800 Message-Id: <20201106094853.21082-6-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_044949_839971_B9EB31D7 X-CRM114-Status: GOOD ( 17.42 ) 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 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 It's needless to initialize memory events for reporting, this patch moves memory event initialization for only recording. Furthermore, the change allows to parse perf data on cross platforms, e.g. perf tool can report result properly even the machine doesn't support the memory events. Signed-off-by: Leo Yan Acked-by: Ian Rogers --- tools/perf/builtin-mem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 21ebe0f47e64..72ce4b8fbb0f 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c @@ -77,6 +77,11 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem) OPT_END() }; + if (perf_mem_events__init()) { + pr_err("failed: memory events not supported\n"); + return -1; + } + argc = parse_options(argc, argv, options, record_mem_usage, PARSE_OPT_KEEP_UNKNOWN); @@ -441,11 +446,6 @@ int cmd_mem(int argc, const char **argv) NULL }; - if (perf_mem_events__init()) { - pr_err("failed: memory events not supported\n"); - return -1; - } - argc = parse_options_subcommand(argc, argv, mem_options, mem_subcommands, mem_usage, PARSE_OPT_KEEP_UNKNOWN); -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel