Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3749284yba; Mon, 29 Apr 2019 07:56:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRuC9QHZfNGflfjUK/D0tDslHxb/hNtCbIqnzQtwrurhMN0c19NNG+wsgAeaOZIRg1j9Vn X-Received: by 2002:a63:a18:: with SMTP id 24mr57539567pgk.332.1556549803227; Mon, 29 Apr 2019 07:56:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556549803; cv=none; d=google.com; s=arc-20160816; b=l64UIlqukGPAqjeAGurqOxCe9FBKtiWZmI21/RIyDJyG0FVwe0SERkv4w8gESUbr+0 4KT7sWUbuFpJAMV2CnenILVO51II+WnoC37xoG+hNUY+HwUEQV3LBU1F5+rEvGt1Z9Hq PSpXOWzaeFjqJZ7TL2j959DA/wYPfbapjaYMb0larPSnZhlJXVcM2bAaiyngPDnBZYe8 GKTFkjyE8+UCsZeYaH68gt/sWgVDjTLfP5nrWgSBQ6NaG6ajN7C/JzWgKYx+VdnglzTb cZNgA3wfTebrZGGGLJwlA9K169BEs88/iFK+sCsPIas2Zz72Y+Co46a3/ps0UjEOYGEn tiXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=F9mD2wxRxwyVo5YOYTQF287corZRVJ66NQPE01wixtk=; b=ZqT7mR5YrFsHGz9YUfDxgNIf67k6B1vTNxyyvUuQ6QzZ4m+Ipd9oPOTEB7cCYhtX24 ZBHrhQNrdH6bpgxi4WvUkoNIcCsuLrBLORjVaw7O0VXQ0Vv0LBSN2aswwEnMyY4xF6fY rg1oPlUNpPv7vaXo9xiEG4Msc7Y6eCBnRNEf3zpPHi8LJux6xWseIxzEqsa/VolQiqgH 2P5QvGmzdCiyeUAbtoKMJPfN4NX8v4w6tADbGDiECMwmKJnH4fsU+eHN6uQbZ0zLCOVv 42132D60QoaU8zawWnBD0eZDjIDMPgv31CV/jht38Quaa45EkldCRG+EnvpNQsEnAuId Jr9Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si5936504plp.304.2019.04.29.07.56.27; Mon, 29 Apr 2019 07:56:43 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728620AbfD2Ox7 (ORCPT + 99 others); Mon, 29 Apr 2019 10:53:59 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59486 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728365AbfD2Ox7 (ORCPT ); Mon, 29 Apr 2019 10:53:59 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 780D280D; Mon, 29 Apr 2019 07:53:58 -0700 (PDT) Received: from [10.32.98.83] (e111474-lin.manchester.arm.com [10.32.98.83]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B00D73F5C1; Mon, 29 Apr 2019 07:53:56 -0700 (PDT) Subject: Re: [PATCH v1 2/2] perf cs-etm: Don't check cs_etm_queue::prev_packet validity To: Leo Yan , Arnaldo Carvalho de Melo , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20190428083228.20246-1-leo.yan@linaro.org> <20190428083228.20246-2-leo.yan@linaro.org> From: Robert Walker Message-ID: Date: Mon, 29 Apr 2019 15:53:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190428083228.20246-2-leo.yan@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/04/2019 09:32, Leo Yan wrote: > Since cs_etm_queue::prev_packet is allocated for all cases, it will > never be NULL pointer; now validity checking prev_packet is pointless, > remove all of them. > > Signed-off-by: Leo Yan > --- > tools/perf/util/cs-etm.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) Tested-by: Robert Walker Regards Rob > diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c > index 054b480aab04..de488b43f440 100644 > --- a/tools/perf/util/cs-etm.c > +++ b/tools/perf/util/cs-etm.c > @@ -979,7 +979,6 @@ static int cs_etm__sample(struct cs_etm_queue *etmq) > * PREV_PACKET is a branch. > */ > if (etm->synth_opts.last_branch && > - etmq->prev_packet && > etmq->prev_packet->sample_type == CS_ETM_RANGE && > etmq->prev_packet->last_instr_taken_branch) > cs_etm__update_last_branch_rb(etmq); > @@ -1012,7 +1011,7 @@ static int cs_etm__sample(struct cs_etm_queue *etmq) > etmq->period_instructions = instrs_over; > } > > - if (etm->sample_branches && etmq->prev_packet) { > + if (etm->sample_branches) { > bool generate_sample = false; > > /* Generate sample for tracing on packet */ > @@ -1069,9 +1068,6 @@ static int cs_etm__flush(struct cs_etm_queue *etmq) > struct cs_etm_auxtrace *etm = etmq->etm; > struct cs_etm_packet *tmp; > > - if (!etmq->prev_packet) > - return 0; > - > /* Handle start tracing packet */ > if (etmq->prev_packet->sample_type == CS_ETM_EMPTY) > goto swap_packet;