From patchwork Fri Feb 15 00:45:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 158462 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp103818jaa; Thu, 14 Feb 2019 16:48:07 -0800 (PST) X-Google-Smtp-Source: AHgI3Iara7m/ZnOvcuw7RkpbAjCLGPw6XM+RaL2gIw8pSF2Vw0cTxfu22EN0nHjWdtYw36TtRuz5 X-Received: by 2002:a63:5b48:: with SMTP id l8mr2681145pgm.80.1550191687834; Thu, 14 Feb 2019 16:48:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550191687; cv=none; d=google.com; s=arc-20160816; b=EMj5mRHWGRYlm3wWwIZyd81hEGL544/s+P/IwDPy+T/Eqm0x7ZeRHuHDiUUhhYQj1Z ZAhVfdbwZ6iXLzZ/UxQRO0Rfa9Q8d+CMkEmYx4GKgRQwhcTwj50L749vwdU+aabJwjUk yqip7IabIPHTqvS2PjJKaoVTDON5HMxZ64J2i9SUQ0ycKgAtx1ZXPkLxPT6BqQvXFiNQ w/8pQGd+0UzSv3pj0iH7R7fYL+fXbLHPjeJiKa5wbSPJSf20kXyiz7sQQ5BGb108OkSa yW8YFQHBm0+hOQbAGvC/PeC7gNhdoo8+NJfz/zo+h97IrQ/e/jFAu1ZOHhuC9uKSnf76 R61w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VupPMCwk6g0mFa+c35jQOriHVJpLYYlPbtnZJCWEUzI=; b=z15S4HyLL3REaVVcRQHfyId3Vk2j2hyEXsig2gkdQ6j/XLKXYo9FrNF6qx7/IViy18 cXJ2pXw4s9MSOdFU1m9gPWnkf0Us0AWdPAqz+SzGJpDvIHIm1mtlLu5n93vZxi8JyjpY ASKCx//unZM1ENpGclJdjtiAwp+U5bRrez4Ce2lOuWf4BAn5hAUGPWISEnyIkoDkBvHB tFgZaAcHLfIPir5X8g5Rm8C/Td5AA+olF5wplBAwl9ArOuzPfbwo0ANsWp6xUvjKEdY2 FcTSxth+MIys/2zs4TIv9+icdca75uyymCbz/TU+R9bfHH2MlWmuvV93CYXTR9kDmOXR vcUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="AYL3kK/2"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bb3si1377995plb.160.2019.02.14.16.48.07; Thu, 14 Feb 2019 16:48:07 -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=@kernel.org header.s=default header.b="AYL3kK/2"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730344AbfBOAsF (ORCPT + 31 others); Thu, 14 Feb 2019 19:48:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:47078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389493AbfBOAsE (ORCPT ); Thu, 14 Feb 2019 19:48:04 -0500 Received: from quaco.ghostprotocols.net (unknown [189.40.103.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 62D97222D0; Fri, 15 Feb 2019 00:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550191684; bh=AKvOAUDF1A6gHIdwLmTBGhV9WD7vf/DuM++OockH3WY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AYL3kK/27dviTrzAVZv0ZSys8F+e8m4Fz6myrjHj7RKCHT7vvsq3ktMpjOKja57KY 6lz+tYBZ0nSssyRFoWX2SWyb3dK8sxLsmh5eYboFZEBS4Xssa4ZGm4z+D/YPR1YQns zizGHQWIoRE1GnXsMWrjv0naKJYmuvWcXXrf+3J8= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Jiri Olsa , Namhyung Kim , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Mathieu Poirier , Jiri Olsa , Leo Yan , Peter Zijlstra , Suzuki K Poulouse , linux-arm-kernel@lists.infradead.org, Arnaldo Carvalho de Melo Subject: [PATCH 31/43] perf cs-etm: Rethink kernel address initialisation Date: Thu, 14 Feb 2019 21:45:27 -0300 Message-Id: <20190215004539.23571-32-acme@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215004539.23571-1-acme@kernel.org> References: <20190215004539.23571-1-acme@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mathieu Poirier 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 Cc: Jiri Olsa Cc: Leo Yan Cc: Peter Zijlstra Cc: Suzuki K Poulouse Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/20190212171618.25355-10-mathieu.poirier@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/cs-etm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.19.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;