From patchwork Sun Apr 28 08:32:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 163002 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp585289ill; Sun, 28 Apr 2019 01:32:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLaiyAUg2jut7G2USyCkvGtKAuwtypKN070JTSfrJu5NIHpMuO5T9fGSWcTDNS/mB/pnO5 X-Received: by 2002:a63:318b:: with SMTP id x133mr4040432pgx.297.1556440376058; Sun, 28 Apr 2019 01:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556440376; cv=none; d=google.com; s=arc-20160816; b=mv5ZxMaa+ALL9NhofrYfPqR56qIK5TJNSuNw1AtEAZq1KZp0/IzII4lq8wFRvtfDQ/ egzwYCgmZ4fYZpD0nIRP3m8bgYEBboOdWCuyBPHo3dg+iSSmlaURgsIvemHGB+nqRGhQ xz0ciztH5UqBpissW9eghDtJm+5h3zlIPEJK3xuGXU42Nz/aLf4tu7obnLnATrR2fNtu jTo4EEwmwZpYZxusNK5mjP5+gVx6biBxL/0DtP81b1agQm1KZcKTS6tGHgt65KV3r88T 44FcXfp7v9EwrUfDM3ggwr1b0epvX32jgYj3pmxde7xvDXsG3wmyW8IneE/zZtr4tB2D kbtQ== 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=za5L9TH7RfVFEUEVo+b+Xe+/+fVMc7D24YekrWmKylM=; b=lFuSCK/bXjjg8jVXLVoS1seU3bb5IVVKZbi0zZoJldMLiAJAuaef+u1RAiUeCn0Lh+ whX3e2FcRf6tEELEznUGaPQ37+5HcOjag8PTM1lFyCXTU+DO6f/BIHZNAGQMiCMMEvhZ ciflBW5OYJ7zX0ef2fzagBqGwg9o60nsJyge/mc5Z25x0Y1KFoiQPVtVXtuKKvT6YBB/ hULsTBwDw53zIV1l9Maaavi7Ou8o1hxA5XoEx924U8UyuXYOAZYBylIhHqVGp0W96wcZ KyV9a2eJ+n/Cxi18nERqXgKHUR5kYAF91h63S572rYLyhVLVN8qWSJnJoQBcUCw8d0JP kjjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aJgC+ktE; 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 f5si5403968pgj.491.2019.04.28.01.32.55; Sun, 28 Apr 2019 01:32:56 -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=@linaro.org header.s=google header.b=aJgC+ktE; 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 S1726659AbfD1Icv (ORCPT + 30 others); Sun, 28 Apr 2019 04:32:51 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45154 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726466AbfD1Icv (ORCPT ); Sun, 28 Apr 2019 04:32:51 -0400 Received: by mail-pl1-f194.google.com with SMTP id o5so3598680pls.12 for ; Sun, 28 Apr 2019 01:32:50 -0700 (PDT) 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=za5L9TH7RfVFEUEVo+b+Xe+/+fVMc7D24YekrWmKylM=; b=aJgC+ktE44qrl5zRP84bJJagrrWxh9plDl7AkXkHZjy0goL6aE1PC0dJYg8ZIvnA3A +SeyCgowcSpuVPm2b9an/EFpBwk1uP/QHaXT5n52kcAGYzziXy0YkvRcsDyz8H+CfFbr ARKRvaIPlHZRQfSy8uk9CSGNt7SLbRYo7XvYq0VivFYyPJhV25nxCS00wim2Y7zX9gmf gXf2OFzrhB2a4KBUJM4+rvcyd0pR12w9B2PGqTlVn6cCE4sm2milmo2T4qD2MJ0iL8Es gdxhlXGn+yM+Lp1h4XB/anMSlFNO+o/GyoIfF7BfHta7+AQ0OEEtOeTsLF9xVvd3oMUB RByQ== 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=za5L9TH7RfVFEUEVo+b+Xe+/+fVMc7D24YekrWmKylM=; b=NwLWv/vVf0xddT5ek78MyHEr54sMgj/SqbcPCvRDsWjwxUNvvyfJXUudNspOubEXDX 2CsRqqW+Fym5g7LQfQaLeviw3OgwmsYiUqi65CjYtTDSTwxvAGU+U2jYWP5IrbJhTjUQ OR8NaN/90mxP5J9jJTe86rc75ci8CJoqXHJGTmKu45UUVQmTQAfIsAUk8egqp6jCAlmv yaHx7UiH0XFwuToTJ5PWEiy3K6dPnCrnTvkd2Qr2SOc1EvFhaGUJqn0QWlEXk7S27hU3 5Vr6FALY1IbXbC/JoGuP3ZZ3AW0/QDo837N6D1EHzUXj2u01HgQt2zB8WCpqbaP71fLT X/pw== X-Gm-Message-State: APjAAAXw8wxzWu3yfnM3lakmTRJWZgw3VWUK2WetoCqi+3QS6QsiTbjC qd/jzZzrZqMBc1mmcIEiBTYuTQ== X-Received: by 2002:a17:902:1103:: with SMTP id d3mr17956465pla.247.1556440370534; Sun, 28 Apr 2019 01:32:50 -0700 (PDT) Received: from localhost.localdomain (li990-117.members.linode.com. [45.33.40.117]) by smtp.gmail.com with ESMTPSA id a12sm31960518pgq.21.2019.04.28.01.32.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 01:32:49 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Robert Walker , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 2/2] perf cs-etm: Don't check cs_etm_queue::prev_packet validity Date: Sun, 28 Apr 2019 16:32:28 +0800 Message-Id: <20190428083228.20246-2-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190428083228.20246-1-leo.yan@linaro.org> References: <20190428083228.20246-1-leo.yan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.17.1 Tested-by: Robert Walker 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;