From nobody Tue Feb 10 17:30:45 2026 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DDF1273D75 for ; Sun, 28 Dec 2025 19:37:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766950624; cv=none; b=Ajf2TFqTL/uzyffjYhtWuVJey7bHklOQY9kbItRMKHNxgnx/An0x7Hgae+aR+gpKLi1l/CTgJBiail75PW8FI2xIcqTeErXjisyntclq+9jl0c+YklI5XIkA/YwTdKAjrt9jyVVCAuTU2XzM72qcR6mZjeN+x5hqPtW6Bv1zXbc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766950624; c=relaxed/simple; bh=Ja68HZD8n/Mecl05e+HzN9NzVeHRRawWqVqaJPniPSA=; h=From:In-Reply-To:References:MIME-Version:Date:Message-ID:Subject: To:Cc:Content-Type; b=Yd+eag745CKsV0Ssa8d2e7ojnnl6gr7VCYH1tABeKNLV0SPsiRznXc6bVa7UDQ9niDGsM0APpua23V6wINmqWMReFkyAmMzUQ4pOXJx9y7r387NIf31fmJMsg7VJrfLgw/b/G8+an0py9C8zcSxZ6++zRE5nf+8leEsuwC9RN+k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=J9d0DImZ; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J9d0DImZ" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5957c929a5eso12471868e87.1 for ; Sun, 28 Dec 2025 11:37:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766950620; x=1767555420; darn=vger.kernel.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=ADTTnGIZjP2u1Oe9R0dqscHBsTYiL86hsl8c8md8O10=; b=J9d0DImZCC39w6HycqCM2XZMuJQvSqR10Ny6abV6N17M5/LhRsHK/cRwbyDIYyaNbt vqLa9sVIeoijmkTzow2yL7T6PCcAmNWwUKn+Jn8h9ErdjYj0OnY0bmeKgirRdEa5fgwF fWBe3rRS3rHhWWn9Yx2l15Ok6OOBL9GJDWSgA0WewZ7EolWNt76QEf+oO/wdVyO/zCAY 6D3UjFdjl4QZPfMAXX2CHbfeXAioPcdgwSsnu/Ql/PkCEEPtJzIhb30LDhlF0aRecfVW T7l6ofa7Xd9Gaxy2aVEJmdxXUcOVD72FyfwvIHwcPQDIN8fEswUFqIzNNI09qZzkJaVd IPdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766950620; x=1767555420; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ADTTnGIZjP2u1Oe9R0dqscHBsTYiL86hsl8c8md8O10=; b=LFJ/JUKtf1X5BGW8Tws4bxV2toRtbDX4/T2A/vvxGG/Nvkz8mU7KZEuAbXpTPDpwY4 jNFhKoofFWJ/3O0NTTq20R4pre3PuuTnco5ZmvRWUx6801CnRQYy07ph7QQrVhdHjeJT TeM87zhVLatnD3rgIRsPpwtOXDgw3U62l0yZseoDBMSrZO1aFjQfL0GsG1zPnsATW43y oAw6ddV/HeM5J3i60yUdAFzV0cl1vqykE/hivzWPp9S5l/69/5gwFwlyHQbgmYLRbEy/ Z1yv6G8dVOsPG0mzTpwjdUG+crqhKfR9nPn2kuqf5d95rUa8Rez9UaZ9DKHqXOkBuU9l fgAQ== X-Forwarded-Encrypted: i=1; AJvYcCXrC6V0L35R/HXXjHSgXG3+JeXgMU9wuS4MjNXTwp76kJ1eOy/dyfhdj3KrzMubcfH621z4F/a8N9KdHZM=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7RyZodr84lOJGCwTPt+jpdriHPJi3L97FR6o7QkIT8jfgic90 ARqin7hfn6RckTs8jEXNs1sXhI2V2lrrFeaTRNFZG2r+6tLk1kCnbhcScnpNLux7v2AElSBfT43 DsMmRlKwNPP+MQ19+XbrEjp4cNmoOkWA= X-Gm-Gg: AY/fxX4zZn6NFT6DrsGcEtwUVRVMFiQeV7scRovkqrGbXysimaBbKhgkx05ZoOo2Tu9 H275bkhtMDUDr2nou9wfF09gETN4Lc04ZzMh7hLVBw0DQkQR0wQspM9mA6s4B/ioGwZTLH0dmG1 edDkhuaNAnaX/eHHNSEHNra6NK4qUNkswx7WMMQgbtb721qlvRRH6IwDd5OxADQqA44en990/r2 U/gjFAJ12oezdeeEXY3GJX7Z7LCZMA6bVHgqDB4me7k4SP2TVcnT/6bZq3tmAwC+dBpEmqzaoxj IVwT X-Google-Smtp-Source: AGHT+IEjLwwl0rS0LTYlhd2cdL11fDgszL6gw/6sfMpPXrUmy9mHWgnuGvwJ+khXGtCLqbUuvebxIoficoUgt+rViVM= X-Received: by 2002:a05:6512:304d:b0:598:f1a1:9611 with SMTP id 2adb3069b0e04-59a17d46307mr9266404e87.32.1766950620107; Sun, 28 Dec 2025 11:37:00 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 28 Dec 2025 11:36:59 -0800 Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 28 Dec 2025 11:36:59 -0800 From: Benjamin Philip X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Sun, 28 Dec 2025 11:36:59 -0800 X-Gm-Features: AQt7F2o4TnnTitmnSO1AXOGAIw0BbCkBgd8exok1Zu9FNWssb4dmPyVfsyXQ8p0 Message-ID: Subject: [PATCH 3/3] Documentation: Coccinelle: document debug log handling To: Julia Lawall , Nicolas Palix , Jonathan Corbet Cc: cocci@inria.fr, workflows@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Philip Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The current debug documentation does not mention that logs are printed to stdout unless DEBUG_FILE is set. It also doesn't mention that Coccinelle cannot overwrite debug files. Document this behaviour in the examples and reference it in the debugging section. Signed-off-by: Benjamin Philip --- Documentation/dev-tools/coccinelle.rst | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Documentation/dev-tools/coccinelle.rst b/Documentation/dev-tools/coccinelle.rst index 6e70a1e9a3c0..c714780d458a 100644 --- a/Documentation/dev-tools/coccinelle.rst +++ b/Documentation/dev-tools/coccinelle.rst @@ -127,6 +127,18 @@ To enable verbose messages set the V=3D variable, for example:: make coccicheck MODE=3Dreport V=3D1 +By default, coccicheck will print debug logs to stdout and redirect stderr= to +/dev/null. This can make coccicheck output difficult to read and understan= d. +Debug and error messages can instead be written to a debug file instead by +setting the ``DEBUG_FILE`` variable:: + + make coccicheck MODE=3Dreport DEBUG_FILE=3D"cocci.log" + +Coccinelle cannot overwrite a debug file. Instead of repeatedly deleting a= log +file, you could include the datetime in the debug file name:: + + make coccicheck MODE=3Dreport DEBUG_FILE=3D"cocci-$(date -Iseconds).lo= g" + Coccinelle parallelization -------------------------- @@ -208,11 +220,10 @@ include options matching the options used when we compile the kernel. You can learn what these options are by using V=3D1; you could then manually run Coccinelle with debug options added. -Alternatively you can debug running Coccinelle against SmPL patches -by asking for stderr to be redirected to stderr. By default stderr -is redirected to /dev/null; if you'd like to capture stderr you -can specify the ``DEBUG_FILE=3D"file.txt"`` option to coccicheck. For -instance:: +An easier approach to debug running Coccinelle against SmPL patches is to = ask +coccicheck to redirect stderr to a debug file. As mentioned in the example= s, by +default stderr is redirected to /dev/null; if you'd like to capture stderr= you +can specify the ``DEBUG_FILE=3D"file.txt"`` option to coccicheck. For inst= ance:: rm -f cocci.err make coccicheck COCCI=3Dscripts/coccinelle/free/kfree.cocci MODE=3Dreport DEBUG_FILE=3Dcocci.err --=20 2.52.0