Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3789057pxj; Tue, 11 May 2021 11:53:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxvpUnN5CuB0Simo0ycfbqMPri/Z42DhKaDU4uaD2dKMtYelhgYCePLtBybbnbtagW+eAp X-Received: by 2002:a17:906:8285:: with SMTP id h5mr32824534ejx.456.1620759221064; Tue, 11 May 2021 11:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620759221; cv=none; d=google.com; s=arc-20160816; b=JtA1sMWS5r+r/g+5qIpYdB406DXZ91wNjk/xS30Qw+lxeBEw2GVf8QaPx9sYYEzAa9 O6MVLRpFfZ1UmY31VoQBvDi2fnSapMKKSTFmR/OV3GwNyuMclvTYNez4XB6HqGR4+8Xe H5p5y5jvzxhvvzAQTEDYPrSEuwIwynz1XsQNpwHdenfhmzRKY7m6ZV5lHcbYooa+0r2X 2Q4JPFWaQg3HkH1kvMA+efBi67N4FgdamZdTdeHs2+G0dFMEtOa71B8Iih63lBmISy1z NdQ/P/eQbFJgIh9y90ssdJm/PS1j1hPGH0XkzMveYWdYGWKiQk+dgSkmN3NZZgfNCKIy zqwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nhCiWTrLaek2l7vUen81GgzaKiSCRGwtP17K82jei8A=; b=h7M6b11fhDHiPO+hFMDBKPG0KDzjwv03D58Q3aZv5LRFllbbxCGRdpeyFYujFYTahf PWJ3Vy8eh6QCcC7AziHXwgxeP2HzA7DC+GU74RcUaXRPLuLqpnJDLR/E8heexzb84VMX bM33cMZajcJp0ZjGcsEp4oXRHl1FFoFULQo4WQ06OzSAe/8/MSBtERaw/+Dp14dvPi1p iMaqdN7lUO2uiGUc/k2lQ8R/4Xben8Dh+z3uRIvwBGaNK0oRBKNdDVMJSBTcljwJrbQK CxvQH+5vJvJwlBub67VKfJ5q1DG2nw4J1CHq1vw/SSY+3bDVR4ncXN/PJMNIOjNS5evk yX/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yhx1L10E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id w15si721754ejb.550.2021.05.11.11.53.16; Tue, 11 May 2021 11:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yhx1L10E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232244AbhEKSxD (ORCPT + 99 others); Tue, 11 May 2021 14:53:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232161AbhEKSwk (ORCPT ); Tue, 11 May 2021 14:52:40 -0400 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4139FC0613ED for ; Tue, 11 May 2021 11:51:30 -0700 (PDT) Received: by mail-il1-x12e.google.com with SMTP id e2so18082217ilr.1 for ; Tue, 11 May 2021 11:51:30 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=nhCiWTrLaek2l7vUen81GgzaKiSCRGwtP17K82jei8A=; b=Yhx1L10EEQDF9KD2LDl5eJfcnHTASJESzEYK0s/A3gNp+lePUTEQT1LFN8Mj73dwiK g49vxxv+ybCQQALpP5kuMlnYjVnD7TW6QZks5w8gLmJTuGl5BpbZGoCSVFtXOpvbSbKM qYHm7CLaJq021V4cJglqkml/tZkmzs/BpnIA0UdUGvXEgOO8ucgA1jGxUKtqrkZxVSCD KojoHWyyUEWVAiBVrZ0iD0Qr/PbA/dPs0Runf+Tgvd1/oRfe2q0YYN6wGLWnHALm5et/ qJhA87XYL42lICWQS2g89yG0x+jgaXx/Oqw5fUpliLuPglH52kA3fxwcRyB9hCg396hO LIyw== 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=nhCiWTrLaek2l7vUen81GgzaKiSCRGwtP17K82jei8A=; b=rPVhm3dCW2CZjMhKfvtAltSwGxair+BfmTkk+YCfh4FeHnnKAOSDBN+LjFDIMegDzY Fam5g2Ca4vVDnsjQieW/1Mai7fTeQNMlxQQU6o9dsWzliQ2D0j1earYgJ4105y0FsBkR jSMbdIZvij6lb3lrgeeRnYIseD1UxgCm/n3oY80KiUPfXGH9PWDLpY5oOCMWJ7pNA5qv b3jYBql5eRDO8TqHkoVSPwiUsMRdlsMzb8Uq68UoIy1KDkm93AVvfj+eHJRcgDWs63NY hPTvwUXJXVjaDrvWdpJgV8ozi6LzglOcM0wTBFRp3lqmTzuhQ4/MnlAS6XCxvnoEeD7K LxNg== X-Gm-Message-State: AOAM530VBwVHXhxwyOLZo6SS+Iqwjyv8aq9P34y2oi5zA1jcGzJzka5v c/VsolG/dE2EBKXHsBLQa6A= X-Received: by 2002:a05:6e02:80b:: with SMTP id u11mr28566931ilm.153.1620759090309; Tue, 11 May 2021 11:51:30 -0700 (PDT) Received: from frodo.mearth (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id t10sm405096ils.36.2021.05.11.11.51.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 May 2021 11:51:29 -0700 (PDT) From: Jim Cromie To: Jason Baron , linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Jim Cromie Subject: [RFC PATCH v5 11/28] dyndbg: refactor ddebug_alter_site out of ddebug_change Date: Tue, 11 May 2021 12:50:40 -0600 Message-Id: <20210511185057.3815777-12-jim.cromie@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210511185057.3815777-1-jim.cromie@gmail.com> References: <20210511185057.3815777-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the JUMP_LABEL/static-key code to a separate function. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 5faf49054b1d..a4ddafdbd9a1 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -191,6 +191,18 @@ static int ddebug_match_site(const struct ddebug_query *query, return true; } +static void ddebug_alter_site(struct _ddebug *dp, + struct flag_settings *modifiers) +{ +#ifdef CONFIG_JUMP_LABEL + if (dp->flags & _DPRINTK_FLAGS_PRINT) { + if (!(modifiers->flags & _DPRINTK_FLAGS_PRINT)) + static_branch_disable(&dp->key.dd_key_true); + } else if (modifiers->flags & _DPRINTK_FLAGS_PRINT) + static_branch_enable(&dp->key.dd_key_true); +#endif +} + /* * Search the tables for _ddebug's which match the given `query' and * apply the `flags' and `mask' to them. Returns number of matching @@ -227,13 +239,9 @@ static int ddebug_change(const struct ddebug_query *query, newflags = (dp->flags & modifiers->mask) | modifiers->flags; if (newflags == dp->flags) continue; -#ifdef CONFIG_JUMP_LABEL - if (dp->flags & _DPRINTK_FLAGS_PRINT) { - if (!(modifiers->flags & _DPRINTK_FLAGS_PRINT)) - static_branch_disable(&dp->key.dd_key_true); - } else if (modifiers->flags & _DPRINTK_FLAGS_PRINT) - static_branch_enable(&dp->key.dd_key_true); -#endif + + ddebug_alter_site(dp, modifiers); + dp->flags = newflags; if (dc) -- 2.31.1