From patchwork Tue Feb 12 17:16:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 158170 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4089438jaa; Tue, 12 Feb 2019 09:17:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IbHxg2UdUoZR87KQK0yGvg4cIrGPohXUZfGJodaycNhQ6r4VFAZVHJZEdbJG1hKy7l+BqPJ X-Received: by 2002:a17:902:bd8e:: with SMTP id q14mr5017273pls.153.1549991822027; Tue, 12 Feb 2019 09:17:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549991822; cv=none; d=google.com; s=arc-20160816; b=rg0VdFVLEV4GO1zjPOqSpSqh5OlljwUKRuxoqSTn0rk8i9SWZgjTenbH/tRv4Aj6fr FL/se4yGADdSmh73SNiNt1E5tOMGVnvuE8jHHpP6TjT2cL2J+vgGMFMkcg1P2WLCJ3Nd 493GLtOiAOWGFURsFJRNIuDn/SuzZr6865KjKHbCSrsk6Db7mFuy4XSs+Vm/GRrP+HhG qhu5b1qdyDDc3OOe4+7E8fMszJm7RgXTFpgB9f3aK2zcoaseidF7EgC9DLwOh4mtrnmt jD78o2kFrygbuXBBO0Xwy1UvjxVczPP7lPc6lo2WrBXR7PSk6Os1nry9BtPwYLyytheS U6bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=AqOVPM1vkj1BcrdjSYH7HyHM4JuITQIO8J2Q0BieCKs=; b=w9bvT33AGE3XeED4FQfUuglGUm+qWyEJq17zxxfVOcdDDo4soAQxK0jWLjKH7gtILm qpPeZmYLMOZId6kycuitz02V4al4ZHtpp5WbFffc2Lufq1yAjojo4BPJ/+osjp33U10h 399+hTT8ajF9Fhn5m84TJs1OBMlpmNcdeLGxsz48pSE8mOFWUKkPyOMWITz813P/pQDH lBgAhwhc0eJqyPjN16upIjw1c+EnrYkxLEbHLZIBN59DcjAd5Ls2oni8alS5q7KLYPPq 6kWANxIs8C1DmVBGCdhvq5QsUTMUkPr1EMRk/YhG/8X+oQU3/vxYzFKzOZb0TdkeqoN5 LTIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EaEbAYCm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2si1201394plp.380.2019.02.12.09.17.01; Tue, 12 Feb 2019 09:17:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EaEbAYCm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731835AbfBLRRA (ORCPT + 31 others); Tue, 12 Feb 2019 12:17:00 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36447 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731798AbfBLRQb (ORCPT ); Tue, 12 Feb 2019 12:16:31 -0500 Received: by mail-pg1-f195.google.com with SMTP id r124so1553163pgr.3 for ; Tue, 12 Feb 2019 09:16:31 -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=AqOVPM1vkj1BcrdjSYH7HyHM4JuITQIO8J2Q0BieCKs=; b=EaEbAYCmXtoB46vY9L0sicfUIQl51y7gdkSivvKVXdgCulNJFy3rGyTHCYw7FsdztW QGbtQdVdQ13XLwiDeCegaCUYqUOonZlJklzCrQiXmv2hbBnsOncAyHpuLQoc94IU+Onn czV39rUvqxM5LG6U0m+E8kVYtgyZYcp/y3zVaoXoQOhxH9v3cwHLwpZOtCNUXn1hDe7Q feyHanRxoQyS9Tx+fZNEnxHxy9AQkwaoWGR1RwmvOF+wmhHcr/zvF0Z1ls4anxSBBLym o6aTw29G7Ml/Zs47lwpeNF4q7LNXMppTazLo9qyWW7rKkAtdOK9lbbEkScHamCX3nDnr /2mg== 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=AqOVPM1vkj1BcrdjSYH7HyHM4JuITQIO8J2Q0BieCKs=; b=ahuhOOySDKkhI4WZZ2jhanPAh2dfoNvuTlyue29mj7BGmk2xPKUNHjzPf7iycczRHa Q3DvM5l+eIbMLAAI0a1AZiWsxElNRZtHZ0IhFLXPHv4sivErCAlaxkgz8JGsBr0AtbZF KUTE/Jg1kDZ87U2EmnCv6/nlRjglzSUYRxpGdguQEkgXKN9fMLHCSzhtMEfZlb51jvm+ l8434habZc+Y5oyCqARtFroYMVMuiQtGMCNPzKTdAQj2Say8J0SETjTQ92mX3kgQ6Dau ioXVRBur6fDiE2kKdDKnos1pF+/oTHCnYJZiBwYO7l4QkZ5K3yoxb3sVoj8Xpxup8nkq GVbg== X-Gm-Message-State: AHQUAuZrAelVQK2leM1fHEr/Ke1sLxeK0JMgveYAIz25TuCXtUfpVxkd yJQ+dDByUaeHF6+aJwvpMD+Q/Q== X-Received: by 2002:a63:2ccd:: with SMTP id s196mr4551020pgs.194.1549991790712; Tue, 12 Feb 2019 09:16:30 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id z4sm8659231pgu.10.2019.02.12.09.16.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 09:16:30 -0800 (PST) From: Mathieu Poirier To: acme@kernel.org Cc: suzuki.poulose@arm.com, mingo@redhat.com, peterz@infradead.org, jolsa@redhat.com, leo.yan@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/13] perf tools: Rethink kernel address initialisation Date: Tue, 12 Feb 2019 10:16:14 -0700 Message-Id: <20190212171618.25355-10-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190212171618.25355-1-mathieu.poirier@linaro.org> References: <20190212171618.25355-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Moving initialisation of the kernel start address to function cs_etm__setup_queues(), considered to be the common denominator for queue initialisation. That way we don't have to repeat the same code at different places. No change of functionatlity is introduced by this patch. Signed-off-by: Mathieu Poirier --- tools/perf/util/cs-etm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index c9a5b4935209..2d2de898ea68 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -523,6 +523,9 @@ static int cs_etm__setup_queues(struct cs_etm_auxtrace *etm) unsigned int i; int ret; + if (!etm->kernel_start) + etm->kernel_start = machine__kernel_start(etm->machine); + for (i = 0; i < etm->queues.nr_queues; i++) { ret = cs_etm__setup_queue(etm, &etm->queues.queue_array[i], i); if (ret) @@ -1490,14 +1493,10 @@ static int cs_etm__set_sample_flags(struct cs_etm_queue *etmq) static int cs_etm__run_decoder(struct cs_etm_queue *etmq) { - struct cs_etm_auxtrace *etm = etmq->etm; struct cs_etm_buffer buffer; size_t buffer_used, processed; int err = 0; - if (!etm->kernel_start) - etm->kernel_start = machine__kernel_start(etm->machine); - /* Go through each buffer in the queue and decode them one by one */ while (1) { buffer_used = 0;