From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4B4B8C4167B for ; Mon, 26 Dec 2022 20:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:in-reply-to:message-id:references: mime-version:subject:reply-to:sender:list-id:list-help: list-subscribe:list-unsubscribe:list-post:list-owner: list-archive; bh=RmcwEiUuBcsPcxa9rXqRz+kxCkmwHP3oMR9AYtZDyRE=; b=DKQ3oGc4eL854LD5LyPOVjBnMohDcX/1htlXTM194Exu3ArpJNI8hYD0 F+tzqNISKoWydgc3wBSOWwV+uFxUxFUzbrwDpdIbFaPopEQN2CuLljIPX QepmQNambvWkzYBEOpVFMvihRPxiTME093VMEmBYXfl3Md7j4yK4foJtM k=; Received-SPF: SoftFail (mail2-relais-roc.national.inria.fr: domain of cocci-owner@inria.fr is inclined to not designate 128.93.162.160 as permitted sender) identity=mailfrom; client-ip=128.93.162.160; receiver=mail2-relais-roc.national.inria.fr; envelope-from="cocci-owner@inria.fr"; x-sender="cocci-owner@inria.fr"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:192.134.164.0/24 mx ~all" Received-SPF: None (mail2-relais-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@sympa.inria.fr) identity=helo; client-ip=128.93.162.160; receiver=mail2-relais-roc.national.inria.fr; envelope-from="cocci-owner@inria.fr"; x-sender="postmaster@sympa.inria.fr"; x-conformance=spf_only Authentication-Results: mail2-relais-roc.national.inria.fr; spf=SoftFail smtp.mailfrom=cocci-owner@inria.fr; spf=None smtp.helo=postmaster@sympa.inria.fr; dkim=hardfail (signature did not verify [final]) header.i=@inria.fr X-IronPort-AV: E=Sophos;i="5.96,276,1665439200"; d="scan'208";a="85104478" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 26 Dec 2022 21:51:57 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id 995ECE0138; Mon, 26 Dec 2022 21:51:56 +0100 (CET) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id A5E61E0128 for ; Mon, 26 Dec 2022 21:51:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=RmcwEiUuBcsPcxa9rXqRz+kxCkmwHP3oMR9AYtZDyRE=; b=sFudRSyHAzYqAqG0nTxNPmPWzl8i8bxlVoaErjN2PdafVnecjD/itMVL +t3B/ua4tjJHecArA6aIoAl1m66xUYbwDyuLTqCKS5Sbmd8GKzu7o+Eqv 5S/SHVL088HkksQeowudAJELh1R1VsPBprUdfKruldxUgLq7hukM9nXct k=; X-IronPort-AV: E=Sophos;i="5.96,276,1665439200"; d="scan'208";a="85104477" Received: from 214.123.68.85.rev.sfr.net (HELO hadrien) ([85.68.123.214]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2022 21:51:56 +0100 Date: Mon, 26 Dec 2022 21:51:55 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Deepak R Varma cc: Julia Lawall , Nicolas Palix , cocci@inria.fr, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Saurabh Singh Sengar , Praveen Kumar In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [cocci] [PATCH v2] coccinelle: api/atomic_as_refcounter: include message type in output Reply-To: Julia Lawall X-Loop: cocci@inria.fr X-Sequence: 796 Errors-To: cocci-owner@inria.fr Precedence: list Precedence: bulk Sender: cocci-request@inria.fr X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Mon, 26 Dec 2022, Deepak R Varma wrote: > A common practice is to grep for "WARNING" or "ERROR" text in the report > output from a Coccinelle semantic patch script. So, include the text > "WARNING: " in the report output generated by the semantic patch for > desired filtering of the output. Also improves the readability of the > output. Here is an example of the old and new outputs reported: > > xyz_file.c:131:39-40: atomic_add_unless > xyz_file.c:131:39-40: WARNING: atomic_add_unless > > xyz_file.c:196:6-25: atomic_dec_and_test variation before object free at line 208. > xyz_file.c:196:6-25: WARNING: atomic_dec_and_test variation before object free at line 208. > > Signed-off-by: Deepak R Varma Applied, thanks. > --- > > Changes in v2: > 1. Correct word test to text in patch description. Feedback from Markus.Elfring@web.de > > > scripts/coccinelle/api/atomic_as_refcounter.cocci | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci > index e63d52408b86..bbe5b2932933 100644 > --- a/scripts/coccinelle/api/atomic_as_refcounter.cocci > +++ b/scripts/coccinelle/api/atomic_as_refcounter.cocci > @@ -55,7 +55,7 @@ identifier fname6 =~ ".*call_rcu.*"; > p1 << r1.p1; > p2 << r1.p2; > @@ > -msg = "atomic_dec_and_test variation before object free at line %s." > +msg = "WARNING: atomic_dec_and_test variation before object free at line %s." > coccilib.report.print_report(p1[0], msg % (p2[0].line)) > > @r4 exists@ > @@ -88,7 +88,7 @@ fname@p2(y, ...); > p1 << r4.p1; > p2 << r4.p2; > @@ > -msg = "atomic_dec_and_test variation before object free at line %s." > +msg = "WARNING: atomic_dec_and_test variation before object free at line %s." > coccilib.report.print_report(p1[0], msg % (p2[0].line)) > > @r2 exists@ > @@ -107,7 +107,7 @@ atomic64_add_unless(&(a)->x,-1,1)@p1 > @script:python depends on report@ > p1 << r2.p1; > @@ > -msg = "atomic_add_unless" > +msg = "WARNING: atomic_add_unless" > coccilib.report.print_report(p1[0], msg) > > @r3 exists@ > @@ -126,5 +126,5 @@ x = atomic64_add_return@p1(-1, ...); > @script:python depends on report@ > p1 << r3.p1; > @@ > -msg = "x = atomic_add_return(-1, ...)" > +msg = "WARNING: x = atomic_add_return(-1, ...)" > coccilib.report.print_report(p1[0], msg) > -- > 2.34.1 > > > >