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 5255CC636CC for ; Tue, 31 Jan 2023 16:20:20 +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=0n+mJxgxs0NjZTUoK1NxshR5hBdjTmfAAZy1P4B3Xbs=; b=kiB5QHw9Tz9S/6ENfaJX1TKKBiJurQIGx1ga+OEYXtxnrGE6USPcKBiZ PK+uChcqvVMysfCE8Y9foxsiFXoX/aJ2m+YMu/xnBuEKtXcElEGe9nk8C r22yYsQuV1ps1aFTZpNQtWjdcgiVQ2PdMypnbG9OTL7SbNhrJJRPSHtsE U=; Received-SPF: Pass (mail2-relais-roc.national.inria.fr: domain of cocci-owner@inria.fr designates 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:128.93.142.0/24 ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:89.107.174.7 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=Pass smtp.mailfrom=cocci-owner@inria.fr; spf=None smtp.helo=postmaster@sympa.inria.fr; dkim=pass (signature verified) header.i=@inria.fr X-IronPort-AV: E=Sophos;i="5.97,261,1669071600"; d="scan'208";a="90354945" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 31 Jan 2023 17:20:18 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id 0139DE7446; Tue, 31 Jan 2023 17:20:17 +0100 (CET) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 7CA5CE743E for ; Tue, 31 Jan 2023 17:20:16 +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=0n+mJxgxs0NjZTUoK1NxshR5hBdjTmfAAZy1P4B3Xbs=; b=pUAAgYfjWeTo/xJLayS4cmfLkCAunpTu7lzSalVT12N9sMB13X/hHPvl WmMxs791Nc4bsBV9uMMZIRmtAYhT5bhXX+DJl8/V/sjTfW1TjlBLTEZTE cgFxBm0J+U0SP0oMvCmwKJ8qAjj7wO10bwAz9mL5yhAnAl7NHkgekPH7H g=; X-IronPort-AV: E=Sophos;i="5.97,261,1669071600"; d="scan'208";a="46496228" Received: from dt-lawall.paris.inria.fr ([128.93.67.65]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 17:20:15 +0100 Date: Tue, 31 Jan 2023 17:20:14 +0100 (CET) From: Julia Lawall To: Luca Coelho cc: Markus Elfring , cocci@inria.fr In-Reply-To: Message-ID: References: <808cd549-f96d-872d-a4db-30ea33095207@web.de> <8f3f48170bab688aff69571913dbe27fc195fe1f.camel@coelho.fi> <543612938885a445d33ca5ae6d04a06a753c1caf.camel@coelho.fi> <2338a91ffe751ceb6325e76bc526b84ca85fc4c8.camel@coelho.fi> <3f376cb31e9050d005417809a9fa51d92cdc57d6.camel@coelho.fi> <13bf65ac8504fa5ebcaf69539422fcd38bf157d1.camel@coelho.fi> <23ba4681-0b9e-cf60-5422-64526cdf462a@web.de> <079efecb-91da-e111-1a28-2c883b69af7b@web.de> <99bb02f6fdcb711102ef0b544fd6cf5a5dd90f97.camel@coelho.fi> <4ce77f5f-2433-bb99-9270-f66267a84432@inria.fr> <9f4c958a4bf370f7eb5fe49ac2be380ada6d9ac5.camel@coelho.fi> <48a02a321c06093966bc9999f9e8333f391475d7.camel@coelho.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [cocci] Searching for special function implementations with SmPL Reply-To: Julia Lawall X-Loop: cocci@inria.fr X-Sequence: 860 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 Tue, 31 Jan 2023, Luca Coelho wrote: > On Tue, 2023-01-31 at 17:08 +0100, Julia Lawall wrote: > > > > On Tue, 31 Jan 2023, Luca Coelho wrote: > > > > > On Mon, 2023-01-30 at 12:59 +0200, Luca Coelho wrote: > > > > On Mon, 2023-01-30 at 11:47 +0100, Julia Lawall wrote: > > > > > It doesn't find the file with the definition. You may need to give more > > > > > paths. > > > > > > > > > > I have the impression that the result is improved with > > > > > > > > > > -I drivers/gpu/drm/i915 > > > > > > > > > > Maybe -I drivers/gpu/drm/i915/display is necessary also. If you add the > > > > > argument --relax-include-path then just -I drivers/gpu/drm/i915 may be > > > > > sufficient. With that option, it will just hunt around in and under the > > > > > various include paths for a unique file that has the required name. > > > > > > > > Alright! That _does_ improve things! Now I can see lots of DPLL matches > > > > in that file! > > > > > > These files I'm trying to parse are so complex that I keep bumping into > > > other parsing errors. Here's one of them: > > > > > > parse error > > > = File "./drivers/gpu/drm/i915/i915_drv.h", line 385, column 1, charpos = 9644 > > > around = 'for', > > > whole content = for ((id__) = 0; \ > > > badcount: 7 > > > bad: } > > > bad: > > > bad: /* Simple iterator over all initialised engines */ > > > bad: #define for_each_engine(engine__, dev_priv__, id__) \ > > > BAD:!!!!! for ((id__) = 0; \ > > > bad: (id__) < I915_NUM_ENGINES; \ > > > bad: (id__)++) \ > > > bad: for_each_if ((engine__) = (dev_priv__)->engine[(id__)]) > > > ERROR-RECOV: found sync end of #define, line 395 > > > > > > > > > I believe the parser is getting confused by an iterator inside an > > > iterator's definition... I already tried to add them both with the > > > "iterator name" directive, but it didn't help... > > > > > > Any idea what I can do about this? > > > > If you don't care about finding things in this code, you can just ignore > > it. > > I don't, but this seems to be included from intel_display_power.c and > I'm not getting the matches I expect in this C file... Maybe there are > other hints in the debugging output? If you know a function that should be matched, then you can check if there are bad/BAD comments in front of that function. bad/BAD comments elsewhere don't matter. You can also use the --debug option and see if the macro name that you expect is getting collected. You can use the --verbose-includes option to see if the file that contains the definition of the macro of interest is actually found and included. julia