Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2200991ybl; Thu, 5 Dec 2019 13:53:51 -0800 (PST) X-Google-Smtp-Source: APXvYqyzLwhJevbWOERpyZkgCl4VfHbgqYEWCi5lQERQYV7p35zhUMeh7Ur5tI783Iwhw8RrQjWf X-Received: by 2002:a05:6830:579:: with SMTP id f25mr8816290otc.248.1575582830940; Thu, 05 Dec 2019 13:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575582830; cv=none; d=google.com; s=arc-20160816; b=I8U2Y8nX79APREqYLl0UYe1OLys0BF5J3vO1r0rzDEnBTOUkD/GgA5EO10spO2Wi85 fNkTRuwMq7i1J39EGdG4XUGBsBZGjNUbycpZ2jaFxmdUOW9OAGlA4Is2YCJLDNBe6J91 Qeynz8W5aGV6f5HwVEC5FR2BkI/dmCiYPRv50bp74HEJc8m7/74ygmuf/V6x1CDXMbaB 7e6VRedA0CVe2pMQWh+ea291dFJvWA5u1xuyB5OhAoVgtP1tQDi0i0KFHP02lHlAzvmH kR5+e1si/AhQKeG0y2EZxX+R+I0Aj4Kx7sWdbEJLfMsm38KxhY1XYG2A+2ukYaEFUryg D7Zg== 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=CE8w0wMRoXjYU5yMlPYtNhR9/So/tLdxFIEhs/BR7j4=; b=UExTO76FbB63V3V6FL0evhT1eddRt0y4JSmvz0syrMczM3v8h0jHAuAf18NjTqxDcm RL5mK7YT1TdCdOlklXXfhICImKeSCE26n1OaWGGI9T/bTZBEcAFAahOlsujl2CHD8M5X C7FObWRNuJVzf1CsU/Z0jeVdbT7XnHzAunppnVawiw4uLPKW0aX0OAPmCZUk/ViI8ZvP 8YQEmSgYelEtZwHsAAtmjG9/N9U2BqyCVpxoX5pj/ydnbLHvZUywXP+g2TwhzC0GWqa+ Y2n/lZDXgu0aypZPQN7R9trRRkLTqDArG4V9Jxci7mNTrZIVgpzrYXSVaMjLXawFnK2b xz4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QRTPKDSl; 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 g17si5766692otk.252.2019.12.05.13.53.38; Thu, 05 Dec 2019 13:53:50 -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=QRTPKDSl; 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 S2387466AbfLEVwa (ORCPT + 99 others); Thu, 5 Dec 2019 16:52:30 -0500 Received: from mail-io1-f65.google.com ([209.85.166.65]:42058 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387435AbfLEVwV (ORCPT ); Thu, 5 Dec 2019 16:52:21 -0500 Received: by mail-io1-f65.google.com with SMTP id f82so5222613ioa.9 for ; Thu, 05 Dec 2019 13:52:21 -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=CE8w0wMRoXjYU5yMlPYtNhR9/So/tLdxFIEhs/BR7j4=; b=QRTPKDSlv/GL3XjawIYtaGXvXGngPuI8Ikxc3pTEP6Nh2z88/MoQGdiKTMyVeuktv/ KUffij/CcrAWNZuHYXk0WqTljhQVd6Aa9DTqRtSNaAmA9Kv5RxuBl5Uu0PuYjfoDiuQh RXYG1cyOVRX3cHNema2EpmuV/9jvYMockgAMzJIFr40l2T6pKLARDP0cT08Fir3T6ZRv LEseFEXsUu6T+UNTwcNE5sCtjVSIz++HT8I2YMZxXF9BEbfGI0O9ReSjLo4AOEycXY6A tdEpYElxzaa6pphxrWxnh1ldlBh7x9WetfGo2j1Gj41zPNxfwXtFHs88ctjfK8xKS/Fq oUrQ== 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=CE8w0wMRoXjYU5yMlPYtNhR9/So/tLdxFIEhs/BR7j4=; b=F5+wPn4lI4B45Sgi9xJ2+oKTAEapVgY1nLdk2030TJLndTriDVzFJ9JX+t5nL0raDU vZxcIda7BnbxXuitYBRWQ1mj9HzZkykj3ydRN6vdbor2rAb4wM3h2Gs2T67OeXIabZ1d KUF6twCi9Z33bkJSzalPMMydeY/kQR+DtD88YbbQ6cCCApyLyD8Q5BiJXx3vsWxMZsj8 BZFicrVOErYzN5PLuBm7/uGqiFzYNjv0EJ4AtZH8NV8FDyHuGsZT0fTMBI1uHD/4+PmZ fsgAMnAtcoltaH5YGz9570MCVr2uepWqr19ZvxjCxd694EI3o9LDgW3OXwYsaBnuks/K aOEA== X-Gm-Message-State: APjAAAVH8s8vTOX35DGrI5vY3mOhgzaiT0SZhoieH25lAGKCGLQCl3Tr aTCpUyVPHgLAcCGaZqUdBzs= X-Received: by 2002:a5e:df46:: with SMTP id g6mr8110770ioq.240.1575582741135; Thu, 05 Dec 2019 13:52:21 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 13:52:20 -0800 (PST) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: linux@rasmusvillemoes.dk, Jim Cromie Subject: [PATCH 11/18] dyndbg: add filter parameter to ddebug_parse_flags Date: Thu, 5 Dec 2019 14:51:42 -0700 Message-Id: <20191205215151.421926-12-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 Add a new *filter param to 2 functions, allowing ddebug_parse_flags() to communicate filter settings to ddebug_change(), Also, ddebug_change doesn't alter any of its arguments, including its 2 new ones; mods, filter. Say so by adding const modifier to them. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 0d1b3dbdec1d..8c62c76badcf 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -147,7 +147,8 @@ static void vpr_info_dq(const struct ddebug_query *query, const char *msg) * logs the changes. Takes ddebug_lock. */ static int ddebug_change(const struct ddebug_query *query, - struct flagsettings *mods) + const struct flagsettings *mods, + const struct flagsettings *filter) { int i; struct ddebug_table *dt; @@ -445,7 +446,10 @@ static int ddebug_read_flags(const char *str, struct flagsettings *f) * flags fields of matched _ddebug's. Returns 0 on success * or <0 on error. */ -static int ddebug_parse_flags(const char *str, struct flagsettings *mods) + +static int ddebug_parse_flags(const char *str, + struct flagsettings *mods, + struct flagsettings *filter) { int op; @@ -477,7 +481,9 @@ static int ddebug_parse_flags(const char *str, struct flagsettings *mods) mods->flags = 0; break; } - vpr_info("*flagsp=0x%x *maskp=0x%x\n", mods->flags, mods->mask); + + vpr_info("mods:flags=0x%x,mask=0x%x filter:flags=0x%x,mask=0x%x\n", + mods->flags, mods->mask, filter->flags, filter->mask); return 0; } @@ -485,6 +491,7 @@ static int ddebug_parse_flags(const char *str, struct flagsettings *mods) static int ddebug_exec_query(char *query_string, const char *modname) { struct flagsettings mods = {}; + struct flagsettings filter = {}; struct ddebug_query query; #define MAXWORDS 9 int nwords, nfound; @@ -496,7 +503,7 @@ static int ddebug_exec_query(char *query_string, const char *modname) return -EINVAL; } /* check flags 1st (last arg) so query is pairs of spec,val */ - if (ddebug_parse_flags(words[nwords-1], &mods)) { + if (ddebug_parse_flags(words[nwords-1], &mods, &filter)) { pr_err("flags parse failed\n"); return -EINVAL; } @@ -505,7 +512,7 @@ static int ddebug_exec_query(char *query_string, const char *modname) return -EINVAL; } /* actually go and implement the change */ - nfound = ddebug_change(&query, &mods); + nfound = ddebug_change(&query, &mods, &filter); vpr_info_dq(&query, nfound ? "applied" : "no-match"); return nfound; -- 2.23.0