Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4840547ybg; Tue, 29 Oct 2019 13:13:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6DODAgeGZjADHwCDO64m6DQIJZUWojpPx65cr5e0B7838fu6Y7q9gu7xOVk46PRTPB6xZ X-Received: by 2002:aa7:d891:: with SMTP id u17mr27288412edq.282.1572379997036; Tue, 29 Oct 2019 13:13:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572379997; cv=none; d=google.com; s=arc-20160816; b=NY+jA3UvR1e+lCdNLKUaHsueVqWgE2oc6KnEFhKxRzlRbLvUDACi8M6Jph2DpASIv1 QofwzJrEl9H0wbI5LTxRWyABZ0/ekmG+g2B505QkX0pe4c7oVxucUz8qyE39djvu5lrj f1qIQ+wi4/n4/asInhpsp6+AwMtBHQg+8L9itkGadl3Ug1xLQAZMMKHsrvw8VBiDbIjV /hXOYOqjHKniUIXHLtriJ2ZAlw+11EjXXJycLfddMWgf240c7dxtvF4QOyJd5sAb6xkq ixIgECNZkXxSd2P7vgOFkmg+K+zz9iVZqCq9N4DaiTstK/SFMjpuBr834YkySrVVZ3i/ GSmw== 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=L6XMcK0TgQyED/+3WKhANhwDjSMsgCtUa0b29cO4tKk=; b=A9jAhXYo+eycfcHopyvClYQwNvYAW66+LT1okcWXs7T3mWZTLCGagzXZ3mDO2bV1G0 kmavHw6u+vwut2LeotVXn9QDyt/5whqRP1f2Y7pvPwzDRQ85hQm4y0DTvQ/DJ5KoqKjw MPaq/X7C2ByFs5Wwf3TTNQhbWVlrDXREf49VdgO2DLkbWe4a0Krmoj1ty6KdhqcsKppc ntwTT4oq6rjl5IngaIFa3wHgH4O5g5cG58fAX3HtPyELNjAOoIpH8T2QCO4U9rURtGL3 THQEixowesa8mnVcj2fdIFSzY159dKQQQpV6DkHDm+bnU8Lp1am7xxJ4e/Yr2mU4z9Do bvxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XDzKxlR2; 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 u11si11148963eda.235.2019.10.29.13.12.53; Tue, 29 Oct 2019 13:13:17 -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=XDzKxlR2; 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 S1728779AbfJ2UBJ (ORCPT + 99 others); Tue, 29 Oct 2019 16:01:09 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:43029 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbfJ2UBG (ORCPT ); Tue, 29 Oct 2019 16:01:06 -0400 Received: by mail-io1-f68.google.com with SMTP id c11so16178760iom.10 for ; Tue, 29 Oct 2019 13:01:05 -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=L6XMcK0TgQyED/+3WKhANhwDjSMsgCtUa0b29cO4tKk=; b=XDzKxlR2PeWEcyNikS0iGgqcRRPxFlqSdJuM5idQ4dPKW+2tj2VPg2sRpyw+AzuvM8 nZo2LD9Q34OsIDiyTHpiwL8F80KwXfTMQK12Canq5RNyKLp047RV68ePnicCWDntPuhi aNHttC/MTVdZl5lgTm9JE5a5aGPGnKa6V2C8u1vkZsvEy+pcoe13Bbc3ZdU5faXO+lr4 Mf0rYyb0CDAekCpfEp/dw2JD4owmgnON9igkkmDquB4vMAghJmSz4sop0jW5Q86ci8oH bVXyDAuZvFNRyeZCxTub9JOUMI4B3kH7b9lRKxbm5oZa7U3zXeKj/i/XeVnfEX/iEfXp y6RQ== 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=L6XMcK0TgQyED/+3WKhANhwDjSMsgCtUa0b29cO4tKk=; b=HC44Cf6UNM6PQNt/5JpZLDOJsqrmdD4JWSNjhJWy4m3fiyyuvk+Cna52/AnIcqwMC4 yU/8YPwHYNETCioQZBM7sMs4z46nl5/R+Ib4zZ6tc/09vhnfrnDLHHCyqNA3oWDWw+Ya RjLRlYNg1czM4vBKI09JyoD/EN9NfCAzKOyG3D7Tg17B3rVd/mhMOtq+WNtMGbmoYRTd c3snT0lZ4jpRJJmjzl3rOUZRMkhwKcZy3pkn8qBMTubQtrspy2Uc/8l5SZKLYQB25T5w GfH3ski9ZXmYY6Z/AruJuIrdUOZRROzJK7mVRx2JTo/g6EfjW9KDWH+ntsehcDNeCT/c 8EJw== X-Gm-Message-State: APjAAAXov2u3b2B7jBEsOhONgx8clZrWMBun6QeyriioJ/sS8f89A5b2 sqwDVcXcV5qB10O2NA7Ae8w= X-Received: by 2002:a05:6602:255a:: with SMTP id j26mr4361820ioe.155.1572379265488; Tue, 29 Oct 2019 13:01:05 -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 n3sm2236491ilm.8.2019.10.29.13.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 13:01:04 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, linux-kernel@vger.kernel.org Cc: linux@rasmusvillemoes.dk, greg@kroah.com, Jim Cromie Subject: [PATCH 12/16] dyndbg: add filter parameter to ddebug_parse_flags Date: Tue, 29 Oct 2019 14:01:02 -0600 Message-Id: <20191029200102.10201-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 Add a new *filter param to 2 functions, allowing ddebug_parse_flags() to communicate filter settings to ddebug_change(), Also, ddebug_change doesnt 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 5cb44088fff5..173b28250bd6 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -134,7 +134,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; @@ -430,7 +431,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; @@ -462,7 +466,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; } @@ -470,6 +476,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; @@ -484,12 +491,12 @@ static int ddebug_exec_query(char *query_string, const char *modname) pr_err("query parse failed\n"); return -EINVAL; } - 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; } /* 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.21.0