Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4099879pxf; Tue, 16 Mar 2021 05:55:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfcIWg0/nnV8X55642WeO3VcAObm9L024Lmevy8ZzUYyT9fjZCt+ENNWzh9gjvAclrpw+/ X-Received: by 2002:a05:6402:254f:: with SMTP id l15mr35999547edb.189.1615899322321; Tue, 16 Mar 2021 05:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615899322; cv=none; d=google.com; s=arc-20160816; b=RYSOUQluc0mwNEzJLiX+CXjEtaw569x9Q7AEwyCgaIcfJK/XjAdoHeRH+VMq5v4oGh WCyzYviM9TyJJNzExJh72Zd/uLiPxLgZuRK819fqIhxdG7UCSwOR3o9rAm92G+5BIAWb erpHUV5wAZNeZ5l9ccIpUjW9c5haCPNhlb2k0BQrk0CdtyVWjAwmXTBjY1FvC9xpeIyK Lzx4cPFzc47oy/4kvA1I2bHX0J2U2+Y6XRZaN59n/B5RJFE1kBA4gXwlOzhRmv3mILKf 6UzQM6WoY6k3u9Dx8pRwneQNl2vg4M8hWJx+TrdJdhz37lFwDxct6prkWLMVtygF1A24 4oYw== 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=0l3a9Uzu/ZRgWPegPcgX+r7C1XlHwt5hH3uR9JYCAhU=; b=GRWPwGuusMbtQHySdcfRpYX3WFwa14531M3F9rz82OeA3EVI4lpdszuyoid5OLc9nP 6GdJXj5Ok2jWNVthZSaj/CcrYrdrkPVDACwz+Mr//ogd6aFxoDVkII24Ntq5GSV552g1 4JtoqcNDy90rrP0g4Dt2sA4+RGAXe5I5q5WppDLmFPw9HV6z2EQwOztlu2Eq3fXYclOh KgKPDDvCtFjq+6tUEJ/lBTqe4Ou+RMFFwMSlZHYyqV40Ssu5/7B1hBFAZv4nxsjw7Lh9 P4o5hpEMGEofI6IhOJTfRImh6qzZLc7T35J0vTPTrj0U8bYuLR74IwCZ3XofnrKrygMl iClA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GKcRVDCm; 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 l24si13985081eds.501.2021.03.16.05.54.59; Tue, 16 Mar 2021 05:55:22 -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=GKcRVDCm; 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 S235273AbhCPFJF (ORCPT + 99 others); Tue, 16 Mar 2021 01:09:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235196AbhCPFIa (ORCPT ); Tue, 16 Mar 2021 01:08:30 -0400 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0851EC06175F for ; Mon, 15 Mar 2021 22:08:30 -0700 (PDT) Received: by mail-il1-x12c.google.com with SMTP id b5so11528921ilq.10 for ; Mon, 15 Mar 2021 22:08: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=0l3a9Uzu/ZRgWPegPcgX+r7C1XlHwt5hH3uR9JYCAhU=; b=GKcRVDCmsyXRAn4KH3qJDUjjzRPCTC4qwUi817VOVcVKbgG+FDUg8tekaG6OqsBams LOV9FMDOSSJ2TdsgpzsU7kKG5bzoOQ6LhsGM9wWZO9XQutYNQzvuwrnUu9zUqkMZBwnh 1mAZfhggKGx22G6Dj30Ql4zLTUcwZMeFts/RSOxj8JdIswx7PsT5z+86kkU28Jm5SdG+ Ap7E4LEZTHpI5ubOzpZXGBbIrNiB9pREnrqV1wB3IT6Y6EJ4Bn+2M5zOB0lp0p0m3sYj SyO9Tpm7oJA75JssNo/1HaH9QnUa7Qn1qdChzCjvkgHkuI/YMCn9mQgg+i+IatD8Xcv6 sgRQ== 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=0l3a9Uzu/ZRgWPegPcgX+r7C1XlHwt5hH3uR9JYCAhU=; b=neE4oCy5Zszs/UhglXgeiE7MTGHm2CrF6/+O/Y3j62cGrcoeI+PaSjjnzwfnUXdKZT syDQvGfgiKUpaEWZos1YdvG5ZPdz83GFA7yP/Iu4wfeq8yjGzY+lOh6uZyCfPSykDwaD ExdBsj+Zq725uy3uQypJH5gelqmh0+zc+9mHXwOLXGlHUjP4V1hWnjXoJw1vXVDcXFS6 sOg/84TQY+NJI5etW6F4JontDPwNyTU1hwaDKp2iMwZ5pFtcA2vKVeORW2+ZwyKr+qvN zhdA/jYThlE2M7Q+lZTCpp4lmfFIu93FHUhBDbyuoanTbftqB+8OFr+MSoYrn3LrRpHP W37w== X-Gm-Message-State: AOAM532HFqH+f0AgaTkDxKqSBsxtAS6h6wcuL/tF8emROVB+QM7DUT7f GSR5eRS4XWiI3GuqnKW5cLGZwaHBiY6CTQ== X-Received: by 2002:a92:d80f:: with SMTP id y15mr2281194ilm.96.1615871309534; Mon, 15 Mar 2021 22:08:29 -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 y9sm8587469ill.15.2021.03.15.22.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 22:08:29 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [RFC PATCH v3 11/18] dyndbg: refactor ddebug_alter_site out of ddebug_change Date: Mon, 15 Mar 2021 23:07:54 -0600 Message-Id: <20210316050801.2446401-12-jim.cromie@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210316050801.2446401-1-jim.cromie@gmail.com> References: <20210316050801.2446401-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 2d011ac3308d..6fbd9099c2fa 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.29.2