Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp187023ybi; Tue, 2 Jul 2019 18:49:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGfdGVSmjTYbHgNKc3jEvGqL1j0wrloX3ewVvLbDWiEHM7E3ANSIkEs5/XhiJoKm0IIvgg X-Received: by 2002:a63:69c1:: with SMTP id e184mr30774699pgc.198.1562118542285; Tue, 02 Jul 2019 18:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562118542; cv=none; d=google.com; s=arc-20160816; b=Toue+OFN/1jIFC/Jj+t0PJKqiq7ZUg57nKhx6lggHgejqKgsd7hbw7hkEFG+O4ahBO duWrF+neNaZnGr4fJMXqUcLplDG9OGoyDZWzUrRzKXvbn280/SzaFBXNw3an9qO1J9YF B+cLE/C2x3VEt4fTQglHGfg+of7BUl+2Bs05tNvetgMwvDOEcgzB0aFb4Y5VBix6qG+R kX3tUqzs6gut0JF4jccgIAI0UF+P46dAzO30MAZcKsQOTeCURuXqAd+StFmtkIJdFJpT B2MLj/VrK31oDj6EUuDUtPAFTBdbZF7y3V/FMQbQ6bKAvk00oZahXt57oJlLjQE5c5ao o66A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/lRiznl/b3k1Ie9ScyJ4jBFeaEoI2ZI3USYbKQfR1J0=; b=QWeXGi2F41RpsZOrBDdYAtIxWoUdQ3oN2FO2m8R/5piMGt2U8WAw48lFvJC2enh63w Ly9jUrhPIii3WxyvydcO8+iDpIFFNN4MMa2wnOQ4Orbff2VEWgq/+VzltQchCaHkP7kG 8pm8Wl81bTFW1MnRhMRZeztA6WDDXLxIUytwvyak5p0C/SVoKLkfRbsoBRSdeIQK7Po1 fsDGMQ93DFffNTm0eWhBi2swy7/Ipkxl3hP1UFwsim6PovNb9f+iIYb1HLriTPCkcsbz 94SgeMeut/l/2ZPXeJmJqQFxi7QAqNg2aQmO6DZ3X+TcNj8+tHVqFwzNJiJ6EMwsGN99 WTxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zQMpxxLG; 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 gn14si491175plb.395.2019.07.02.18.48.46; Tue, 02 Jul 2019 18:49:02 -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=zQMpxxLG; 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 S1727197AbfGCBsW (ORCPT + 99 others); Tue, 2 Jul 2019 21:48:22 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:39971 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbfGCBsV (ORCPT ); Tue, 2 Jul 2019 21:48:21 -0400 Received: by mail-ot1-f67.google.com with SMTP id e8so612828otl.7 for ; Tue, 02 Jul 2019 18:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/lRiznl/b3k1Ie9ScyJ4jBFeaEoI2ZI3USYbKQfR1J0=; b=zQMpxxLGrM0XjdsgBPT6ATLcrb7qA9zfpedH99WHA29nFWVTZMn5gYEGkwE/NO+j58 O0GelD0oUhq/t5UuQIzLN40ZYkRP2zzc1N3lAkXaYN9SpFI6oXBDfRYUYW0DDL7N5Irl PT0IswXptUa0vycB9GEwZibK3zlJafP0FDM+ksQm3Eur3ySQZwANF62OBiy4caGXFFEz 8QPTMYNIwkiFEzQ2hfjAKMDgj9RuvrXBgl2U6TQF3njQH25/FcQL80t57ieCV/qnWoLd Hmf7MuHoNwUEoProeXVs3712q03rie79FXvO9UhNfh702kuBuyTYFuf81Laf6+Jnq97N h3BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/lRiznl/b3k1Ie9ScyJ4jBFeaEoI2ZI3USYbKQfR1J0=; b=d/x5E3dpTglDrq0dz3b6uiELB1rPIas/gdD28J9R6+LqykZuPczhpLD+cuMmnMtG3p CqF+DzVWnyIS6LArrKEAbC4zknAWhP5pSX1rPIt2AO0YszZXUIrP7qwzw8PF0Fmy1+dM Cq/Hx1zMVLGGsdQWm4i1Wg2sHvMWlNgREDl658OK+1+g2jWRV0skrKDMSoNLS78WefCj zSCvgFygPEz4LS5FHn7aiw5FEGAQqlgE0f7Bza780W3FmWyWijUB5Vho+ArGBKdneinj VLD6lqPYfDiLWSzaIWM/MlBXvBDhRDM7bKQwnzDl/cg5eAAqaFFNG/bMKoOgW17ftUmU +wnw== X-Gm-Message-State: APjAAAWc2JnI9/yS82hVFkDf2S37CEw5+HRh6vjE9yGwi9vJ2iSMzksR GpQTJZnaXb4yRP9w684YxXIQOg== X-Received: by 2002:a9d:61d8:: with SMTP id h24mr6357738otk.53.1562118501240; Tue, 02 Jul 2019 18:48:21 -0700 (PDT) Received: from leoy-ThinkPad-X240s (li964-79.members.linode.com. [45.33.10.79]) by smtp.gmail.com with ESMTPSA id p2sm313927otl.59.2019.07.02.18.48.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Jul 2019 18:48:20 -0700 (PDT) Date: Wed, 3 Jul 2019 09:48:08 +0800 From: Leo Yan To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Namhyung Kim , Mathieu Poirier , Suzuki K Poulose , Andi Kleen , "David S. Miller" , Davidlohr Bueso , Rasmus Villemoes , Jin Yao , Song Liu , Adrian Hunter , Alexios Zavras , Thomas Gleixner , Changbin Du , Eric Saint-Etienne , Konstantin Khlebnikov , Thomas Richter , Alexey Budankov , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 00/11] perf: Fix errors detected by Smatch Message-ID: <20190703014808.GC6852@leoy-ThinkPad-X240s> References: <20190702103420.27540-1-leo.yan@linaro.org> <20190702110743.GA12694@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190702110743.GA12694@krava> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 02, 2019 at 01:07:43PM +0200, Jiri Olsa wrote: > On Tue, Jul 02, 2019 at 06:34:09PM +0800, Leo Yan wrote: > > When I used static checker Smatch for perf building, the main target is > > to check if there have any potential issues in Arm cs-etm code. So > > finally I get many reporting for errors/warnings. > > > > I used below command for using static checker with perf building: > > > > # make VF=1 CORESIGHT=1 -C tools/perf/ \ > > CHECK="/root/Work/smatch/smatch --full-path" \ > > CC=/root/Work/smatch/cgcc | tee smatch_reports.txt > > > > I reviewed the errors one by one, if I understood some of these errors > > so changed the code as I can, this patch set is the working result; but > > still leave some errors due to I don't know what's the best way to fix > > it. There also have many inconsistent indenting warnings. So I firstly > > send out this patch set and let's see what's the feedback from public > > reviewing. > > > > Leo Yan (11): > > perf report: Smatch: Fix potential NULL pointer dereference > > perf stat: Smatch: Fix use-after-freed pointer > > perf top: Smatch: Fix potential NULL pointer dereference > > perf annotate: Smatch: Fix dereferencing freed memory > > perf trace: Smatch: Fix potential NULL pointer dereference > > perf hists: Smatch: Fix potential NULL pointer dereference > > perf map: Smatch: Fix potential NULL pointer dereference > > perf session: Smatch: Fix potential NULL pointer dereference > > perf intel-bts: Smatch: Fix potential NULL pointer dereference > > perf intel-pt: Smatch: Fix potential NULL pointer dereference > > perf cs-etm: Smatch: Fix potential NULL pointer dereference > > from quick look it all looks good to me, nice tool ;-) > > Acked-by: Jiri Olsa Thanks for reviewing, Jiri. @Arnaldo, Just want to check, will you firstly pick up 01~05, 07, 08/11 patches if you think they are okay? Or you want to wait me to spin new patch set with all patches after I gather all comments? Thanks, Leo Yan > > tools/perf/builtin-report.c | 4 ++-- > > tools/perf/builtin-stat.c | 2 +- > > tools/perf/builtin-top.c | 8 ++++++-- > > tools/perf/builtin-trace.c | 5 +++-- > > tools/perf/ui/browsers/hists.c | 13 +++++++++---- > > tools/perf/util/annotate.c | 6 ++---- > > tools/perf/util/cs-etm.c | 2 +- > > tools/perf/util/intel-bts.c | 5 ++--- > > tools/perf/util/intel-pt.c | 5 ++--- > > tools/perf/util/map.c | 7 +++++-- > > tools/perf/util/session.c | 3 +++ > > 11 files changed, 36 insertions(+), 24 deletions(-) > > > > -- > > 2.17.1 > >