Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5820112ybc; Wed, 27 Nov 2019 09:56:22 -0800 (PST) X-Google-Smtp-Source: APXvYqyVnZt+A7a5lxmDVFrdgqTBSrfm8qZc5N78eLbLskbZUT4oMpg0AQAM+c2wJ/XKsbDwnXYg X-Received: by 2002:a05:6402:54a:: with SMTP id i10mr32764467edx.230.1574877382054; Wed, 27 Nov 2019 09:56:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574877382; cv=none; d=google.com; s=arc-20160816; b=ecBNk6mBNi10coFt6sXPeqVLx6Jw1zCT+qCJfovdwGuA9via6IZbD/oGldDPBlp/ip 7lTKaaw4M/HwSuw1vf3RAlFhQwzC6K7d3XoOcQckq1LgusEtK3YDAvAAxVBBXT62Uvon erqZy6Z59GChb0fzRKuaUBxoFVXTonRzcSc5lVO6fz1tunOH72ftq1DpFyPs3B1qxEYs lYpJAAx3kkXb+JeRtCO9uiwJRtn4IueZBA/+SICLZft87CDU/9m7gdEDl8VLl70Ykh52 U+mE8OQ/vnRu7jqVmA57sFsp39yibHfzFG7bi6rFism1SR0PsN7SOHxVzqdtCoCiuVDh +RNQ== 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=xkTFpkb5r8yGg3ZllYhT/TfhMsW8y8XB6bOw4rnyvIg=; b=ch4BBQ8/b1bt5HQZTROInXzeH3B11kWnPJNWqzb+VlY4BVLnsNuQVc7Y3afvuGD3Q2 vQ8OEUN1/dxg7rX586dCE3e6Tb8bmrc+EFo0feGZHI9Z7nPN2cf8eOJdVWqTjLg2RCaw u0D+0oo+R8AoFyXvRGLg3Nq5S7Y/n/w6hIGlsa0adaxCTfsmL7xTorIfVsdtMVwdIwVp IOFmWtHRleHiMElctyCEju+UHO49g6BXczBT4EBtE4ZFe8FgCN3PGvepnLsX3yRQmXsH KeCAhE/xRZeXctoD5iI+CjhoWyAOPbynF0tYk3C8YDtfEsve9JzIxmGUI5x3stPs+NKz 4WrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sd60D36c; 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 w10si10287696eja.116.2019.11.27.09.55.57; Wed, 27 Nov 2019 09:56:22 -0800 (PST) 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=sd60D36c; 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 S1727403AbfK0Rv4 (ORCPT + 99 others); Wed, 27 Nov 2019 12:51:56 -0500 Received: from mail-io1-f50.google.com ([209.85.166.50]:35662 "EHLO mail-io1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbfK0Rv4 (ORCPT ); Wed, 27 Nov 2019 12:51:56 -0500 Received: by mail-io1-f50.google.com with SMTP id x21so25868637ior.2; Wed, 27 Nov 2019 09:51:55 -0800 (PST) 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=xkTFpkb5r8yGg3ZllYhT/TfhMsW8y8XB6bOw4rnyvIg=; b=sd60D36c3gKuRUo0c8JHhGZ4Mv/X9usffrUt7h6oIqM8CZx40W4OEKCQayAkHzC3sE ADP8ol7roUh4s4QFwoFnDHq+7Kex/I/kSJ7q3IUvQ7PRFjEvAHIyS2RSXhC/597uD9Vx NvYuD2Lvkcva3ooK5lwqd8GnVn/lBLewB7rwzdVGUGCLRzAF5evrVvfYAw+JmZNQ+qZd Or0afYsOX9H+GpRZF65iDEgi3V4mquV5aVk+Q0WPjeLbQiV0IN99JIpEpejlIfe9egwj ZMpxtdcP/bvECZg/dpxnCwVuEcdJj8v4pejac45n9Y+kq9VCm4pJqyAS8kK2Hk1g9U2u h76A== 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=xkTFpkb5r8yGg3ZllYhT/TfhMsW8y8XB6bOw4rnyvIg=; b=b9ESC0Xlse+PhPa1Aaze77JEAJioUlq50FAazkrzqsLLVt8YwdFZdxJz46JUx50rkv GrdWJTlziJrvqzcKwvP6fcDM5iEfCStdp1wPbKCwEXlBZv6lh6Ayq5TLPQUqHCEVCR23 Wz8UJuYhUlpVo0x9zkn20R4ToU/zVXz28xEdSfFhqzSXyZfJ07FzaYsXTX8HkhYAycQD ogul/UVgP94qJHsYTRPcO0smP9iBK1phv2NVNJp81FaDLjVVlTmIP7y5C/upiPNFLtnT SPTn72z8kjddf74o0MDGEkyMgUYsFj8vhOWRrlV1EysY9a2O6hrWY6hThuzfLaf0Y5sH Jm9g== X-Gm-Message-State: APjAAAXQ0qcdslSOkpc1vVwB6VOnjL3GBP0wlLxmm5eeSRl7I6XaZ5tG QKhTa5V/gqLNpbzk0auMvV0= X-Received: by 2002:a5d:958d:: with SMTP id a13mr36252257ioo.144.1574877115174; Wed, 27 Nov 2019 09:51:55 -0800 (PST) Received: from localhost.localdomain (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id j79sm4588510ila.70.2019.11.27.09.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 09:51:54 -0800 (PST) From: Jim Cromie To: jbaron@akamai.com, linux-kernel@vger.kernel.org Cc: linux@rasmusvillemoes.dk, greg@kroah.com, Jim Cromie , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH 15/16] dyndbg: allow inverted-flag-chars in modflags Date: Wed, 27 Nov 2019 10:51:50 -0700 Message-Id: <20191127175151.1351999-1-jim.cromie@gmail.com> X-Mailer: git-send-email 2.23.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 Extend flags modifications to allow [PFMLT_XYZ] inverted flags. This allows control-queries like: #> Q () { echo file inode.c $* > control } # to type less #> Q -P # same as +p #> Q +X # same as -x #> Q xyz-P # same as xyz+p This allows flags in a callsite to be simultaneously set and cleared, while still starting with the current flagstate (with +- ops). Generally, you chose -p or +p 1st, then set or clear flags accordingly. # enable print on callsites with 'xy'; and re-mark with just 'z' #> Q xy+pXYz Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 8 +++++--- lib/dynamic_debug.c | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 5404e23eeac8..493e74a14bdd 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -250,9 +250,11 @@ only callsites with x&y cleared. Flagsets cannot contain ``xX`` etc, a flag cannot be true and false. -modflags containing upper-case flags is reserved/undefined for now. -inverted-flags are currently ignored, usage gets trickier if given -``-pXy``, it should leave x set. +modflags may contain upper-case flags also, using these lets you +invert the flag setting implied by the OP; '-pX' means disable +printing, and mark that callsite with usr-x flag to create a group, +for optional further manipulation. Generally, '+p' and '-p' is your +main choice, and use of inverted flags in modflags is rare. Notes:: diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index b2630df0c3a5..82daf95b8f64 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -488,15 +488,17 @@ static int ddebug_parse_flags(const char *str, /* calculate final mods: flags, mask based upon op */ switch (op) { + unsigned int tmp; case '=': mods->mask = 0; break; case '+': - mods->mask = ~0U; + mods->mask = ~mods->mask; break; case '-': + tmp = mods->mask; mods->mask = ~mods->flags; - mods->flags = 0; + mods->flags = tmp; break; } -- 2.23.0