From nobody Sat Feb 7 21:30:37 2026 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) (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 974BE33FE1A for ; Tue, 6 Jan 2026 19:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767726573; cv=none; b=WXDUsrRDk9pbS49wWHNpfWQ8TcGzaOzzg3tHlyTRt2jMcBzC1pvGUu0OQ9HAf452j1A8OxaBcEezo1j70IDnJsf2zEsofDGB259DX2pXc+LZD5/+OZjC9OvM3Kxj5yEV7gekZY59rG3PzhyioMdY33FPqorQxok8DguqZc1wpVY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767726573; c=relaxed/simple; bh=j0jDV4lbFVQ9QVQdB139GuIVebX7BEtCYepQXaLrbqE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mvTX3uJBwjJwVik1Ru08NgPAxt0dwsJSbOcq7k1OsxOaXTpPund2rggoh55tMaDkA9mm06bSk1p9WrXgg4paGWhYFYctkQBYepl0tr/4qlpkKWDaQYqRYMhAORRZhmxBkSX/Hjab0HfGHBAjH+0DhalHFGudXyQQUvN/krxIjtg= 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=FS6D/Mta; arc=none smtp.client-ip=209.85.214.194 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="FS6D/Mta" Received: by mail-pl1-f194.google.com with SMTP id d9443c01a7336-2a0834769f0so13236645ad.2 for ; Tue, 06 Jan 2026 11:09:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767726571; x=1768331371; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7ZDIxAuQXdSZKM+omOFdw1K6fCzWMGD3B/LiysTgYjs=; b=FS6D/MtaN2mec5qP9Q2U7xSzHsDTnCfOl01/noWmYTPyH2osEUrnCX8bDLz2nVJqbm OZZyC33z8LppBERZS8VGJHrAFKUeymTSdow3dTfe7CB43z1R6yOQzRVVJ8vvy69G3ZMu YgdnXptH+lI0NMu/B1MJ+zkGw1OA4xE6+2AnwTKKTy2j/14GqB7QzERjL1OgPr11oAht SV5QI9uSi4xQ6uhxuf7R3yrCjNEPajlnWuRpUeB6V0veQH7LenSI40mfmT+1egx4cWAJ yoceJFfHC4l+tuwObO15/JeiptK06VGDQtMJxpu1jRhDleW6GUH4chW4vAHTLt3pbTgb 2qHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767726571; x=1768331371; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7ZDIxAuQXdSZKM+omOFdw1K6fCzWMGD3B/LiysTgYjs=; b=BKMaPPSplsCxttCjpTcDzC0btyJoxHLc4t8B+YQA560VuQDshMC8Ejy8ZQjgMyBRRV wQ1a8Z86ZK894ZFYVcbCS+6FpA3z+5dmDlp4YGhUD7x5wrPlHhMP1C4dQDV0mifvSPI4 TFV+wuEBTBXah8Z3J5AV3ydvlpUjA5Jmu0v64phYa8kmn6N6F3mkC61h8i1fi3whRU08 VfXoK4AADTAclFkFKzm2hEX8UW1lZ8nlOQ4l731oLW0iwacLI1Hf4Jd6WIFSXc93QmdV Q+5CmOxUuKWvuKasUjVHk64OnWPOTb1MfegHkt6X9WD6/yV4hp2UhPi37dq92C2IP+CF HSgA== X-Forwarded-Encrypted: i=1; AJvYcCVy5FHDyI7Y7+QJmQZ0Zf5GTufxVhOUzzEoguP3j4GPJhWQoZ9vHrxF1MXS886Q1iemn2IqCgRaooSDMC0=@vger.kernel.org X-Gm-Message-State: AOJu0YxsPSlSiNbFjcLC7dMeSHp43x0exdkBG9Zzcn/kTBaT70d7UHOb VFO0oWZb5mMW5Tlw32Gji3FDc2zqvJUdb4QktRpybxwqxK1VtB2f0OIX7Byf157y X-Gm-Gg: AY/fxX5fkLPTiVuTQ1oFkSU3vEYzEkZA2qwpjT0LQ/QjwBHZkp/hqMj/Ni/LgdVEeuo bTFWAmEDbRIY3vm4Bp8hkIm5BEBmDpIWXSmMWVa90nPFID0YvhAnRRWN+g2HXRBHA0WH6ASFs70 +VH4w2tcYcPquxs1K58FFiBSBjCWYtg8F0TktbtSAlhtepR0QYGRso43MjSqlIb39eluvVENJ1I g+pr4JJWo22OyU8UGk4RvW+rnyWHFUppKmrc4bB3wCQRr1kQE26LBGEM5xFDkcFtkdClaSfFpYu LIH89NEfFVJOjLi+a3L87f4PgUbIMzGlnWUBB8RcEzv92Sk4IdMLQZbCRmfW15Q5kdFzVmmKf82 LMruz81XeZr3m185wXitbTvoSMogbVtU6GgKOpCEgMUfbngIx0ZrsAj0TqIWjXtAxKgiRm8tetM Akpy+7QJ4ljZK7jgttvA== X-Google-Smtp-Source: AGHT+IE1WFyskV9UBz53SZomuLYRFUJQlyS3/Vk4tjY//MxsM+cH3sL/yfbwmTq7HM4vYlJFb86sSA== X-Received: by 2002:a17:902:e80d:b0:295:9db1:ff3a with SMTP id d9443c01a7336-2a3e2df5181mr37055245ad.28.1767726570816; Tue, 06 Jan 2026 11:09:30 -0800 (PST) Received: from rivendell ([101.0.62.234]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a3e3cc78c0sm29380975ad.69.2026.01.06.11.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 11:09:30 -0800 (PST) From: Benjamin Philip 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 Subject: [PATCH RESEND 3/3] Documentation: Coccinelle: document debug log handling Date: Wed, 7 Jan 2026 00:38:36 +0530 Message-ID: <20260106190836.36630-4-benjamin.philip495@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260106190836.36630-1-benjamin.philip495@gmail.com> References: <20260106190836.36630-1-benjamin.philip495@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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-too= ls/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:: =20 make coccicheck MODE=3Dreport V=3D1 =20 +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 -------------------------- =20 @@ -208,11 +220,10 @@ include options matching the options used when we com= pile the kernel. You can learn what these options are by using V=3D1; you could then manually run Coccinelle with debug options added. =20 -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:: =20 rm -f cocci.err make coccicheck COCCI=3Dscripts/coccinelle/free/kfree.cocci MODE=3Drep= ort DEBUG_FILE=3Dcocci.err --=20 2.52.0