{"id":2226498,"url":"http://patchwork.ozlabs.org/api/patches/2226498/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/patch/20260422141234.632195-4-pvorel@suse.cz/","project":{"id":59,"url":"http://patchwork.ozlabs.org/api/projects/59/?format=json","name":"Linux Test Project development","link_name":"ltp","list_id":"ltp.lists.linux.it","list_email":"ltp@lists.linux.it","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260422141234.632195-4-pvorel@suse.cz>","list_archive_url":null,"date":"2026-04-22T14:12:32","name":"[v4,3/5] lib: Prefer LTP_DEBUG over -D","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"8c2640cf4e85d80ca4c96b9003ce989de43cfe2d","submitter":{"id":70792,"url":"http://patchwork.ozlabs.org/api/people/70792/?format=json","name":"Petr Vorel","email":"pvorel@suse.cz"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/ltp/patch/20260422141234.632195-4-pvorel@suse.cz/mbox/","series":[{"id":501017,"url":"http://patchwork.ozlabs.org/api/series/501017/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/list/?series=501017","date":"2026-04-22T14:12:31","name":"lib: LTP_DEBUG cleanup","version":4,"mbox":"http://patchwork.ozlabs.org/series/501017/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2226498/comments/","check":"warning","checks":"http://patchwork.ozlabs.org/api/patches/2226498/checks/","tags":{},"related":[],"headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256\n header.s=susede2_rsa header.b=hTFHObN0;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.cz\n header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=wZ+TBjH/;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa\n header.b=hTFHObN0;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=wZ+TBjH/;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)","smtp-out1.suse.de;\n dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=hTFHObN0;\n dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=\"wZ+TBjH/\""],"Received":["from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g11RZ1Cnsz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 00:13:46 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 529773E3039\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 16:13:43 +0200 (CEST)","from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id D0E483E53C5\n for <ltp@lists.linux.it>; Wed, 22 Apr 2026 16:12:45 +0200 (CEST)","from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 65771600806\n for <ltp@lists.linux.it>; Wed, 22 Apr 2026 16:12:45 +0200 (CEST)","from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104:10:150:64:97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out1.suse.de (Postfix) with ESMTPS id F41906A904;\n Wed, 22 Apr 2026 14:12:39 +0000 (UTC)","from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 94591593B0;\n Wed, 22 Apr 2026 14:12:39 +0000 (UTC)","from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id OMr1IFfX6GnqUwAAD6G6ig\n (envelope-from <pvorel@suse.cz>); Wed, 22 Apr 2026 14:12:39 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1776867160;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=V/S8fwQnripngaxxt2b/dcHdgQS9H8NMiWI6UpFN+HQ=;\n b=hTFHObN0R2aRmiwBpCOF6pfV/Who+Y/xpwkqtWlkqMYtI2FYhIr/gj8NADk+uA0aIdUAn/\n gvFBVOiqXXhdWI7yhT1AIYBo6DAWO2b+KV5Pv1iTLoEOQveBsChhGbRsvW/jhXXn26Fqnl\n ONGzziG7I7xWnfo/UiSjWschLVT0P6k=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1776867160;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=V/S8fwQnripngaxxt2b/dcHdgQS9H8NMiWI6UpFN+HQ=;\n b=wZ+TBjH/5uMaY4rhnQa7XaW5rS5UDoO2RZiv5bNpzlXdJVUzgZLE3icmLo3LAta77RahMT\n CeYqBSKAaJfXYvCg==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1776867160;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=V/S8fwQnripngaxxt2b/dcHdgQS9H8NMiWI6UpFN+HQ=;\n b=hTFHObN0R2aRmiwBpCOF6pfV/Who+Y/xpwkqtWlkqMYtI2FYhIr/gj8NADk+uA0aIdUAn/\n gvFBVOiqXXhdWI7yhT1AIYBo6DAWO2b+KV5Pv1iTLoEOQveBsChhGbRsvW/jhXXn26Fqnl\n ONGzziG7I7xWnfo/UiSjWschLVT0P6k=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1776867160;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=V/S8fwQnripngaxxt2b/dcHdgQS9H8NMiWI6UpFN+HQ=;\n b=wZ+TBjH/5uMaY4rhnQa7XaW5rS5UDoO2RZiv5bNpzlXdJVUzgZLE3icmLo3LAta77RahMT\n CeYqBSKAaJfXYvCg=="],"From":"Petr Vorel <pvorel@suse.cz>","To":"ltp@lists.linux.it","Date":"Wed, 22 Apr 2026 16:12:32 +0200","Message-ID":"<20260422141234.632195-4-pvorel@suse.cz>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260422141234.632195-1-pvorel@suse.cz>","References":"<20260422141234.632195-1-pvorel@suse.cz>","MIME-Version":"1.0","X-Rspamd-Action":"no action","X-Rspamd-Server":"rspamd2.dmz-prg2.suse.org","X-Spamd-Result":"default: False [-1.51 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n SUSPICIOUS_RECIPS(1.50)[]; MID_CONTAINS_FROM(1.00)[];\n NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[];\n R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n MX_GOOD(-0.01)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:dkim,suse.cz:mid,suse.cz:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns];\n DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n FUZZY_RATELIMITED(0.00)[rspamd.com];\n RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+];\n SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[];\n FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[];\n TAGGED_RCPT(0.00)[];\n RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];\n RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[suse.cz:+];\n FREEMAIL_CC(0.00)[suse.cz,gmail.com,suse.com,redhat.com];\n RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_FIVE(0.00)[6];\n FREEMAIL_ENVRCPT(0.00)[gmail.com]","X-Rspamd-Queue-Id":"F41906A904","X-Spam-Score":"-1.51","X-Spam-Level":"","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,SPF_HELO_NONE,SPF_PASS\n shortcircuit=no autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-2.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-2.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"[LTP] [PATCH v4 3/5] lib: Prefer LTP_DEBUG over -D","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","Cc":"Martin Cermak <mcermak@redhat.com>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"},"content":"Environment variable has usually higher preference than getopt.\nThis includes disabling debugging even on -D:\nLTP_DEBUG= ./test05 -D2 means debugging disabled.\n\nAlso reduce duplicity of \"Enabling debug info (level %d)\" message and\ndocument that on -h and developers/debugging.rst.\n\nFixes: e434de62b4 (\"lib: Extend LTP_ENABLE_DEBUG to support verbosity levels\")\nSigned-off-by: Petr Vorel <pvorel@suse.cz>\n---\nChanges v3->v4:\n* Fix typo: \"overwriten\" -> \"overwritten\". Also missing closing ')' (Andrea)\n\n doc/developers/debugging.rst |  2 ++\n lib/tst_test.c               | 25 +++++++++++--------------\n 2 files changed, 13 insertions(+), 14 deletions(-)","diff":"diff --git a/doc/developers/debugging.rst b/doc/developers/debugging.rst\nindex 36dda0d90f..4e162068b4 100644\n--- a/doc/developers/debugging.rst\n+++ b/doc/developers/debugging.rst\n@@ -19,6 +19,8 @@ The ``-D`` parameter also supports the following verbosity levels:\n \n Suppress all debug logs if no '-D' flag passed (default behavior).\n \n+``LTP_DEBUG`` has higher preference than ``-D``.\n+\n Tracing and debugging syscalls\n ------------------------------\n \ndiff --git a/lib/tst_test.c b/lib/tst_test.c\nindex c79cabcd7a..12f7489d4e 100644\n--- a/lib/tst_test.c\n+++ b/lib/tst_test.c\n@@ -654,11 +654,11 @@ static struct option {\n \tchar *optstr;\n \tchar *help;\n } options[] = {\n-\t{\"h\",  \"-h       Prints this help\"},\n-\t{\"i:\", \"-i n     Execute test n times\"},\n-\t{\"I:\", \"-I x     Execute test for n seconds\"},\n-\t{\"D::\", \"-D[1,2]  Prints debug information\"},\n-\t{\"V\",  \"-V       Prints LTP version\"},\n+\t{\"h\",  \"-h        Prints this help\"},\n+\t{\"i:\", \"-i n      Execute test n times\"},\n+\t{\"I:\", \"-I x      Execute test for n seconds\"},\n+\t{\"D::\", \"-D[1,2]  Prints debug information (can be overwritten by LTP_DEBUG)\"},\n+\t{\"V\",  \"-V        Prints LTP version\"},\n };\n \n static void print_help(void)\n@@ -825,13 +825,9 @@ static void parse_opts(int argc, char *argv[])\n \t\t\ttst_brk(TBROK, \"Invalid option\");\n \t\tbreak;\n \t\tcase 'D':\n-\t\t\tif (optarg)\n-\t\t\t\tcontext->tdebug = SAFE_STRTOL(optarg, 1, 2);\n-\t\t\telse\n-\t\t\t\tcontext->tdebug = 1;\n-\n-\t\t\tif (context->tdebug)\n-\t\t\t\ttst_res(TINFO, \"Enabling debug info (level %d)\", context->tdebug);\n+\t\t\tif (getenv(\"LTP_DEBUG\"))\n+\t\t\t\tbreak;\n+\t\t\tcontext->tdebug = optarg ? SAFE_STRTOL(optarg, 1, 2) : 1;\n \t\tbreak;\n \t\tcase 'h':\n \t\t\tprint_help();\n@@ -1453,10 +1449,11 @@ static void do_setup(int argc, char *argv[])\n \t\telse\n \t\t\ttst_res(TWARN, \"Invalid LTP_DEBUG value: '%s'\", tdebug_env);\n \n-\t\tif (context->tdebug)\n-\t\t\ttst_res(TINFO, \"Enabling debug info (level %d)\", context->tdebug);\n \t}\n \n+\tif (context->tdebug)\n+\t\ttst_res(TINFO, \"Enabling debug info (level %d)\", context->tdebug);\n+\n \tif (tst_test->needs_kconfigs && tst_kconfig_check(tst_test->needs_kconfigs))\n \t\ttst_brk(TCONF, \"Aborting due to unsuitable kernel config, see above!\");\n \n","prefixes":["v4","3/5"]}