From patchwork Fri May 3 00:25:29 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: 163283 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp20577ill; Thu, 2 May 2019 17:26:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOiK+U24EPhgaVJV2kH0cQWyRQaEwyo2WxLazwsfmEzPnV8hz40mkgmEZNfINZ0BSTriwm X-Received: by 2002:a17:902:50ec:: with SMTP id c41mr6970245plj.244.1556843189927; Thu, 02 May 2019 17:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556843189; cv=none; d=google.com; s=arc-20160816; b=A8WhmcVp2G7Hg5ZBD/koXxkV+UCZGyesSZFZwJHbpksYvy6arLXj4H9EVoCGAmdEq5 87cTDtsUpHO0+ZgyiJlUcFy09/CFbBVN8sSQFtgAyfQz78U3M2OMAZSRgQB7W7aQxM6Y /V7TSLt1pIYTVwgnfPcX2u8hq8r0Zkwub3bcjBcb1VgPiHpt0L65oW6wNeEE2/Xssvxw RL1d+NWngyU+Rfl29QAED5TFVM4N+Xbmhit8YSeR02ejIB0xb5Rb3OfXjw6AvKfiHZ4Q qvpI1jJKDT9/PK1MMyMxvx9NBk8bnE/RjybAO/oIMl+G9+iWr0Fr2yVfa3b5lUb9Gdhp Xp7Q== 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=BmHE7yeOoJTrm8lors6q3OhgTGYEgN6Q5Zu3pF76FSc=; b=KNANDmp/dbQR2UAOFitO7ncx1gS4W9WoC2ZvOk/rX+smBbTuX5LJibkkaiJCqzDbpN k9AJWJsm7vvHESzgYzOz7q1ERctE3mxLFo+IAB+i6AB8i4ZWIGCkNvZSa9w8hjUlkReV 1ybRcil7kWLIOrePgInkw2zLw55OXh2mB3RwkcrOGSN53C/tl1J0DRImL7EwMGyEJ6Kx 7F4usHxageKMBR7abRqkva720GeVcoUaGjVkgj2XFaD9f+yY0V9mDyAjb4rMDut9tSQ3 qgS7ySTIZ43BGkDwyDZqNafsFaJvByki+mPpydlrVk0fRUTiH3erB6Wy9qqEHxFPt43a 3JuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KJBrDxZG; 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 p9si685984plo.49.2019.05.02.17.26.29; Thu, 02 May 2019 17:26:29 -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; dkim=pass header.i=@kernel.org header.s=default header.b=KJBrDxZG; 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 S1726586AbfECA0M (ORCPT + 30 others); Thu, 2 May 2019 20:26:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:44072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726544AbfECA0G (ORCPT ); Thu, 2 May 2019 20:26:06 -0400 Received: from quaco.ghostprotocols.net (adsl-173-228-226-134.prtc.net [173.228.226.134]) (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 8098021783; Fri, 3 May 2019 00:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556843166; bh=V6PvajlKKbO94N9tpD0LRZ4MKdSxlJ0h4zbL/CW1ovI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KJBrDxZGikPv7ODXs7raFTmF5MSlSpAqAviVGvOaJnzr8n0btgonB+RtLoHP93SgI 9Kr8WIHeXS9VToq+6sLW/ZUXv7f9Y4ynRWnKXEQ5++0k2UlY7bxKuAD1zgGxfeNJ+4 nDewXMgyCQvWO2SLukjaBWa6J0VDNAbU4cEaeYSM= From: Arnaldo Carvalho de Melo To: Ingo Molnar , Thomas Gleixner Cc: Jiri Olsa , Namhyung Kim , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Leo Yan , Robert Walker , Alexander Shishkin , Jiri Olsa , Mathieu Poirier , Mike Leach , Suzuki K Poulouse , linux-arm-kernel@lists.infradead.org, Arnaldo Carvalho de Melo Subject: [PATCH 07/11] perf cs-etm: Don't check cs_etm_queue::prev_packet validity Date: Thu, 2 May 2019 20:25:29 -0400 Message-Id: <20190503002533.29359-8-acme@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190503002533.29359-1-acme@kernel.org> References: <20190503002533.29359-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: Leo Yan 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 Tested-by: Robert Walker Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki K Poulouse Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/20190428083228.20246-2-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/cs-etm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.20.1 diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 110804936fc3..7777cfc1ad8c 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -981,7 +981,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); @@ -1014,7 +1013,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 */ @@ -1071,9 +1070,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;