Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4839383ybg; Tue, 29 Oct 2019 13:12:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvxREWmm9a98PMj6TBIHsM2nenMOx22X/jlM5qhEiiq8xWiX2XQ2X09vqhqDKw3TZgaNs9 X-Received: by 2002:a17:906:85da:: with SMTP id i26mr5355094ejy.186.1572379927269; Tue, 29 Oct 2019 13:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572379927; cv=none; d=google.com; s=arc-20160816; b=wPOrcckGvhtRLwWswL/XQmLVN9uYk82ctYJrJE4arrNKwAk5ZCvZKuTS4xw7pXTOKF 9RrKV5b2Rddtkoi+orjTv9TxLlMhikFikTADS5xak9QShKxno+zxzFkl2Z2gHhOwY1+R DIeW9VxP7KBKoGNI2P+gTJtQoNn4YC0TR55Ib3zFl717ktNf5MODWw9O3HZii6v/z1kl sN1NCqIJxux32kDpQukpYIavr4BOGO96V9V0gw2tBHpJ872fxew1dWGG0fxshZhfQ43e 6KHWxudBGRRiHEw6XrStBapT3zixLmI1bOD0dKpyaJ+9zJngqWkLIBQt0qjvVDDDrwL2 HQAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=XFtN+XGvbR1I6A3qEJqZM9z+JSUPPupQU7FJEjlcOXU=; b=nZ1mlLsFh1DayYhUKf1RjDI9MEwtCdQSjTYMcEq/ZFdCwAoiaLotfGmbQs1NG9lVVF LSnh7W008G+H/fI07ZHNi+qStq7UbyfNlZDGeWDQ8MxxOePs4GwimTLHXlzY1NXYjFri Ne7OYEaz9TrJm2epvsgP/31LwMukC7cc8AdocFkC43L46hWmmemm2ynJHRKD0Po9jyDK fFvTJXsf0Hzn8igR/tZo/rOehOiwYAbZ41wx+exMyMqSl/66yVPx2FFv+Bi0W7MSJi25 lp593zbCBNukU4AXPtpUrbB9dDJ3n7UUyG1eGwpo3/SY4ENO4O1wvvSToJOZdl11NtvZ ODZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JR0vw0hb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10si8956369ejt.282.2019.10.29.13.11.43; Tue, 29 Oct 2019 13:12:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JR0vw0hb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727455AbfJ2UAS (ORCPT + 99 others); Tue, 29 Oct 2019 16:00:18 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:33705 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbfJ2UAR (ORCPT ); Tue, 29 Oct 2019 16:00:17 -0400 Received: by mail-io1-f66.google.com with SMTP id n17so3104080ioa.0; Tue, 29 Oct 2019 13:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XFtN+XGvbR1I6A3qEJqZM9z+JSUPPupQU7FJEjlcOXU=; b=JR0vw0hbABPx+plRSJz53fHZYUuZWTk8x9Ldf8KysVTFsqAdiLX5uJclKbxOrENE1g ep4egRhA43e4I41wtOAZnVzpZZ571NfsusYWFfT2J/zYBa3lH0T4UmLZWCYRcI+MxsNJ aOmVc1Cxe2dtHba9THbRElcuj4PYfhy97dr2W7qYK7Q/6QYSvxCg2fwtWtqHZBKWmpyF Eu70sAcN7VRfGZ8Bzq2uOBHoiPXK1m5akC293s7wCfw/Myw7zauakKhKHk3eT7zD342Z Ww8rStz+26KaU9L0l0n3+FsTxZ7vfN4z2rZH3DrgiZBS4xLJ9T28FDuXeZa+CP7jlHGm 8Hvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XFtN+XGvbR1I6A3qEJqZM9z+JSUPPupQU7FJEjlcOXU=; b=dEViGdBeqwWzxb0k1guYu4SOMe4SY6dbpicjXbSM5OMVHjRfi4THoeHI4begW9LHtg mk4rVSdYKS5hcGA0MrZJFComCas4dXYHMtH7LTX0y7Ezbsfx3IzNfA4tKvPdXSZLfOSx ju6M69S3jriEGw7FVACzpiVYeuajhX8ERFyzFcQnr8jKyGnNrs7TijtrJiCtvCf82G3M cVzYKciSHo3PcK0Nv3jVyS/yeTxh0uEX6SwlTka09qi+RBmsedu+bQkptgTi5EWnR/M1 w5RvlS4/5kkJn5L2sAnjEAKhL/X9ENlKPmpcQwqWRDU3+ZSS152SAiw0BQiKfDYMYxh0 gVug== X-Gm-Message-State: APjAAAW9ChvLcOi/VHE9rkJ5TIU7XAHX07q+SGcsKHY1qhkA62KUwtpD WdHI9sXAyhT9jwv1CNWLWBPmmgzmZas= X-Received: by 2002:a6b:b486:: with SMTP id d128mr5670385iof.47.1572379213067; Tue, 29 Oct 2019 13:00:13 -0700 (PDT) Received: from localhost.localdomain (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id v14sm420iob.59.2019.10.29.13.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 13:00:10 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, linux-kernel@vger.kernel.org Cc: linux@rasmusvillemoes.dk, greg@kroah.com, Jim Cromie , clang-built-linux@googlegroups.com, Jonathan Corbet , Randy Dunlap , linux-doc@vger.kernel.org Subject: [PATCH 01/16] dyndbg: drop trim_prefix, obsoleted by __FILE__s relative path Date: Tue, 29 Oct 2019 14:00:00 -0600 Message-Id: <20191029200001.9640-1-jim.cromie@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Regarding: commit 2b6783191da7 ("dynamic_debug: add trim_prefix() to provide source-root relative paths") commit a73619a845d5 ("kbuild: use -fmacro-prefix-map to make __FILE__ a relative path") 2nd commit broke dynamic-debug's "file $fullpath" query form, but nobody noticed because 1st commit trimmed prefixes from control-file output, so the click-copy-pasting of fullpaths into new queries had ceased; that query form became unused. So remove the function and callers; its purpose was to strip the prefix from __FILE__, which is now gone. Further, there is no loss of query selectivity, and no real value in iteratively trimming ^/\w+ prefix and testing for a match. Also drop "file $fullpath" from docs, and tweak example to cite column 1 of control-file as valid "file $input". cc: clang-built-linux@googlegroups.com I built one clang-kernel a while ago to see if this patch broke things, it did not, but I may have messed up something. Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 19 +++++++++---------- lib/dynamic_debug.c | 19 +++---------------- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 252e5ef324e5..e011f8907116 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -62,10 +62,10 @@ statements via:: nullarbor:~ # cat /dynamic_debug/control # filename:lineno [module]function flags format - /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:323 [svcxprt_rdma]svc_rdma_cleanup =_ "SVCRDMA Module Removed, deregister RPC RDMA transport\012" - /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:341 [svcxprt_rdma]svc_rdma_init =_ "\011max_inline : %d\012" - /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:340 [svcxprt_rdma]svc_rdma_init =_ "\011sq_depth : %d\012" - /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:338 [svcxprt_rdma]svc_rdma_init =_ "\011max_requests : %d\012" + net/sunrpc/svc_rdma.c:323 [svcxprt_rdma]svc_rdma_cleanup =_ "SVCRDMA Module Removed, deregister RPC RDMA transport\012" + net/sunrpc/svc_rdma.c:341 [svcxprt_rdma]svc_rdma_init =_ "\011max_inline : %d\012" + net/sunrpc/svc_rdma.c:340 [svcxprt_rdma]svc_rdma_init =_ "\011sq_depth : %d\012" + net/sunrpc/svc_rdma.c:338 [svcxprt_rdma]svc_rdma_init =_ "\011max_requests : %d\012" ... @@ -85,7 +85,7 @@ the debug statement callsites with any non-default flags:: nullarbor:~ # awk '$3 != "=_"' /dynamic_debug/control # filename:lineno [module]function flags format - /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svcsock.c:1603 [sunrpc]svc_send p "svc_process: st_sendto returned %d\012" + net/sunrpc/svcsock.c:1603 [sunrpc]svc_send p "svc_process: st_sendto returned %d\012" Command Language Reference ========================== @@ -158,13 +158,12 @@ func func svc_tcp_accept file - The given string is compared against either the full pathname, the - src-root relative pathname, or the basename of the source file of - each callsite. Examples:: + The given string is compared against either the src-root relative + pathname, or the basename of the source file of each callsite. + Examples:: file svcsock.c - file kernel/freezer.c - file /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svcsock.c + file kernel/freezer.c # ie column 1 of control file module The given string is compared against the module name diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index c60409138e13..ba35199edd9c 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -67,17 +67,6 @@ static LIST_HEAD(ddebug_tables); static int verbose; module_param(verbose, int, 0644); -/* Return the path relative to source root */ -static inline const char *trim_prefix(const char *path) -{ - int skip = strlen(__FILE__) - strlen("lib/dynamic_debug.c"); - - if (strncmp(path, __FILE__, skip)) - skip = 0; /* prefix mismatch, don't skip */ - - return path + skip; -} - static struct { unsigned flag:8; char opt_char; } opt_array[] = { { _DPRINTK_FLAGS_PRINT, 'p' }, { _DPRINTK_FLAGS_INCL_MODNAME, 'm' }, @@ -162,9 +151,7 @@ static int ddebug_change(const struct ddebug_query *query, if (query->filename && !match_wildcard(query->filename, dp->filename) && !match_wildcard(query->filename, - kbasename(dp->filename)) && - !match_wildcard(query->filename, - trim_prefix(dp->filename))) + kbasename(dp->filename))) continue; /* match against the function */ @@ -199,7 +186,7 @@ static int ddebug_change(const struct ddebug_query *query, #endif dp->flags = newflags; vpr_info("changed %s:%d [%s]%s =%s\n", - trim_prefix(dp->filename), dp->lineno, + dp->filename, dp->lineno, dt->mod_name, dp->function, ddebug_describe_flags(dp, flagbuf, sizeof(flagbuf))); @@ -827,7 +814,7 @@ static int ddebug_proc_show(struct seq_file *m, void *p) } seq_printf(m, "%s:%u [%s]%s =%s \"", - trim_prefix(dp->filename), dp->lineno, + dp->filename, dp->lineno, iter->table->mod_name, dp->function, ddebug_describe_flags(dp, flagsbuf, sizeof(flagsbuf))); seq_escape(m, dp->format, "\t\r\n\""); -- 2.21.0