Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp7397752pxu; Fri, 25 Dec 2020 12:25:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFKx4NGxSjrukjsjdWrdJLypt75qyEIQotkXjvLHMm3X7eC2rRVVs0mAkIcwIOOqLE37TH X-Received: by 2002:aa7:da01:: with SMTP id r1mr33760464eds.45.1608927903948; Fri, 25 Dec 2020 12:25:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608927903; cv=none; d=google.com; s=arc-20160816; b=xTs8Y4FJNPLKlTapA/FnEGsNwh5HtiyXBHQibBNVmklYq7J1hvEeabVJPj0WRUvVAr ZK6tsZTDw3MerpfcXJYT15z3g++AnYYBFXI2mjgiVYU90YF0gEXEa1RlKL6aiZo7gT7O myIA9KvvAa85Mal74VPi1WWzvsevYehclSk+fgeo4QvMxX/pjhViuxWBr8SMseuNsk6C GvFA7HELeM64V0pV612osEG2VIMpPNWgxnepTduDG7tHTAWZKUsufqM06uQN8OawtMrC 63iUNol90r5IKtARaNoTrx7IJuIRl+qsqRr+YAGVO2Be4ZGsSiVTx7f2yZQdRws8US9f FnkQ== 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=LwVcF8sEuPjEGsEv5BDYtdefCLQp/sk8MhkppBLUIMQ=; b=muKtBDuHzVGhK20aN/5LsYPVJ1XDBwvQCmIGBuDrqomyrMEJXtTAy3MzkfIT1K4rW7 CpN4fcU0VpoO8X25Q4Kl4XDmZNEvapxK8j+v4dgUhN5DXbTYo1GJJhmwwQAuk+nwkoiY FkBaHjRmQTi85tNeQnXrybimus2xdjCD3N4hIqE2sEQ0dxrcgVx2kP8rlll1DpFfe25/ OBtmi/zolLYc4Eq8wJJaxUzLWSTJSfxw3tDMvmcHs+2Fi0fLORiP5wNc6o2itZ9/LKW0 8+ex5ZFJK95CQ8KGGw0McyG/YI7dWQRjHHd2oDKYrpVJ0CJY9jZyzrqVttyZZYEl6JKO 05Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ss6UroHb; 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 d1si16776842edy.296.2020.12.25.12.24.41; Fri, 25 Dec 2020 12:25:03 -0800 (PST) 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=ss6UroHb; 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 S1729466AbgLYUV5 (ORCPT + 99 others); Fri, 25 Dec 2020 15:21:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729365AbgLYUVj (ORCPT ); Fri, 25 Dec 2020 15:21:39 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6AB9C06179B for ; Fri, 25 Dec 2020 12:20:25 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id 81so4512509ioc.13 for ; Fri, 25 Dec 2020 12:20:25 -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=LwVcF8sEuPjEGsEv5BDYtdefCLQp/sk8MhkppBLUIMQ=; b=ss6UroHbJXfkNpxzPetNJzyyycgqEzYYERH1m53E24XGFxKATTleUwMV1SYyNsAHjD tzpXw5FukAVzvjVCcOB4BHivBrio+gg8SqVI8syyaPmfHEKqASDe2NP4VQ/HMjbnrI/P fsztL80BjlWWFx0+rj5SBeYI58WzokejdivGorm0972Ze7wf6j5IAeujxaraDqdptEQ1 ejdSNfUmT/RhAwjliD27fjO+E8kjrVIBzt0NkIi4QlUMDdITGHErKBTKsO53HokED7KO be248OXCRZ9CubljuXkmPN9USehmiF9RRaY/+DS/CkXd1FC7RHgVGcPo9nSq/CDC9JnI Sw2w== 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=LwVcF8sEuPjEGsEv5BDYtdefCLQp/sk8MhkppBLUIMQ=; b=ELnd0vupcPiAm5DF/X8Nbya7NcNdpFuPuQ72oEVsOYHjbNsJw9DwCnxBkhYh3BnUn5 FXkxjSUtLbK3ihOCUpMWdW5OpCuUrrbokUi6WzQRqncQ5xx1SD4Du7QQzNehnQEmNF2e xCETX3/lVHMaUctGAlW7OXbwUO4vfgl2GKT1t+RW0CshHajxqqcM3qt/EycPCSDa++wu FpwSZAFHTtbdjxTBboCssNA9IGrc/H07pEcf9Q51wejunQKjDidLsySOqDUf45Wo0URi r2WQrEZ4B4rtcyaanT/hTh+kZMIvjYBxJ6SOnc8tRYjGyCECSFqr7sBI0kyYZN8BChDs wMUw== X-Gm-Message-State: AOAM532/+jiFpSpDuhd+F0fn2mAIyqm3TvEiqrOrKlu8349eNBQ9VLrH flk6pRR6DJ01BZPhsryIV0o= X-Received: by 2002:a5d:824b:: with SMTP id n11mr28751176ioo.27.1608927625085; Fri, 25 Dec 2020 12:20:25 -0800 (PST) Received: from frodo.mearth (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id e1sm28380401iod.17.2020.12.25.12.20.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Dec 2020 12:20:24 -0800 (PST) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [RFC PATCH v2 11/19] dyndbg: refactor ddebug_alter_site out of ddebug_change Date: Fri, 25 Dec 2020 13:19:36 -0700 Message-Id: <20201225201944.3701590-12-jim.cromie@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201225201944.3701590-1-jim.cromie@gmail.com> References: <20201225201944.3701590-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 inline 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 daded73c8575..6203a6ad1706 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -188,6 +188,18 @@ static int ddebug_match_site(const struct ddebug_query *query, return true; } +static inline 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 @@ -224,13 +236,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.29.2