Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2201267ybl; Thu, 5 Dec 2019 13:54:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzHT2+v5JeMa/Gfw5sxQ8c8jtco+78KlNi0OpxkxV/BFk+srmkF+ZC3JATHUAOynxFgMdT3 X-Received: by 2002:a9d:48a:: with SMTP id 10mr8006346otm.95.1575582849308; Thu, 05 Dec 2019 13:54:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575582849; cv=none; d=google.com; s=arc-20160816; b=Z3DAJmULg8FoJmNRiJnGrI8NvlPAk+f3qbJcyvj09sBg7r27PA6N9xiSIeY9yIRsgV ec4KB5ZlK7pNOawhwuZr1LrdMB/2gDk3cCPl9DoM6KR6qwHNCqKJd3H0axczpFNvROMB zhVQh95XmdWx2ZWdZjedN7yuKktoVid2Yqe7o10x8uv895GIjyTJ4BfJkSfZw971oK2D PLhQ34x/afm4Ve0yYUiWviDaWt8eNmBvxEEXW9xhd0DRSFYBn3mEtHhECmP8Zk3Uf1bX IU+8PzY2retmcW4AIfs8HX3GYqM6q4Ncs8nLQpfoQmQBhuuwLoX0UZM1z8zVS4KUibU/ E+2A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xkTFpkb5r8yGg3ZllYhT/TfhMsW8y8XB6bOw4rnyvIg=; b=HIRyHrtZjgRHwxKQIggW6Q6xGLLFTOMw2F3WtRUz9gVbOps8IZu+J7ZF/73+jtbMFX s77BkfTvQCDbsEQvaZpZaEZDw/Cjg9TzFt4LCoX5LzEroT61wM3FlXdwgRJKO9mSRpKN a8U7UiZuy1tnlVpdg2co0rM4Br7Gx25dBsn4tiEWRdFXnVyKboMVGvlPjTsGnSKEiy5Z pKUT6SId0td4sl8jM+ZtuWlEd9qLom2LH20XtNHB+eTod6uPuRcH8jfy45xo3O7YgLRs F1uoNT7Pf0BAK7vieyRjRyqxyvzrSIqiHGrfj5RedBtPxk7LON1S9thlXRRGd7iwz0WF TixQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ffaYczkn; 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 q126si5627842oia.8.2019.12.05.13.53.57; Thu, 05 Dec 2019 13:54:09 -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=ffaYczkn; 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 S2387547AbfLEVw6 (ORCPT + 99 others); Thu, 5 Dec 2019 16:52:58 -0500 Received: from mail-il1-f171.google.com ([209.85.166.171]:33231 "EHLO mail-il1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387477AbfLEVwe (ORCPT ); Thu, 5 Dec 2019 16:52:34 -0500 Received: by mail-il1-f171.google.com with SMTP id r81so4422752ilk.0; Thu, 05 Dec 2019 13:52:33 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=xkTFpkb5r8yGg3ZllYhT/TfhMsW8y8XB6bOw4rnyvIg=; b=ffaYczkn/kQm7dm/iFZImyt/WYcBEj9KRyZiBUzvm+skncdGrLVtSFy6t3UN5zTJbk uKou2USrUqz3Tzbs3t9DPa0As25fXXJVvoglPU6KiVITC7+RX6iFSvMpsfgvhaEEWWEC JnxR0iNaw4sqhpNfgNEeJdAJJxZBFdUFfZ9TNtShb5gjDtSe3eYbgGh3E5ltclZUxHSf LOAqE4676d9rR8/JOxIlIXqWie9N73hUSTZFFeN51lZUnVvozRkRW+0EeDrB6er//dq+ 71z3lXVqrHg6zya6q9ghiNQeuE8XVxak5YBDHJ+L2EabhhieFpj1ms/1mujGhJQ/X9le o5AQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xkTFpkb5r8yGg3ZllYhT/TfhMsW8y8XB6bOw4rnyvIg=; b=S9OXaP1KutV+cigNuwNzUIWyS3cHZdDDwSmiYI7b1lJ6M/JJK69LJkrEsp6PMKdv70 BS+LVp3EP2LPHl80seaBuwd/5tjAdYtLazw4R7a+4kSBKi2ejQ6n4ZWzOGzkw8tdwye6 x2CRq/qaAJloyJb2KEXiUEt3phjALAYlzzaL2kazsid9nU96Mrwk9kf7Xb8W66CsMhXe /RgWtEwb539DfGrmlo2KaE9bkwXEOuA6mOVepOdhhTuoKJ+fHl4CS6Q0ZrcXb+X18+38 xOopxH6riwg0JaNTyvAsiy9iBSa2ZqGmBHnF5djgY0niGlXTyEPzycbHf7SAir48Vcyx FgTA== X-Gm-Message-State: APjAAAVbv7i+VKD9XQPiVv/zoVJ3J/Mltlm9P+uf6Q3Xcwz4aIAFEcqx s1ZJQAqkmtDAveFF18/CEpc= X-Received: by 2002:a92:b604:: with SMTP id s4mr11666899ili.114.1575582752925; Thu, 05 Dec 2019 13:52:32 -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 n22sm740184iog.14.2019.12.05.13.52.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 13:52:32 -0800 (PST) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: linux@rasmusvillemoes.dk, Jim Cromie , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH 15/16] dyndbg: allow inverted-flag-chars in modflags Date: Thu, 5 Dec 2019 14:51:47 -0700 Message-Id: <20191205215151.421926-17-jim.cromie@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191205215151.421926-1-jim.cromie@gmail.com> References: <20191205215151.421926-1-jim.cromie@gmail.com> 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