Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp103450pxf; Tue, 16 Mar 2021 23:58:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6j0BsLI3baFNJGgYgmeN72T6Be9D0H91043GtftYyBV022Q+7UYlNsaRbJqBZwBmV8ieV X-Received: by 2002:a17:906:abcd:: with SMTP id kq13mr34625731ejb.477.1615964317224; Tue, 16 Mar 2021 23:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615964317; cv=none; d=google.com; s=arc-20160816; b=DpYFLUSCp5Ytjtzl49LLW38uWjRFYzo0Sa1C5MN3O8RYUBIgFac58sd+tvYumY1xkv 5yVF8tqQ8lhi1eTJDOPR7XxCyferF1emuY9dgEuWbWhIGCv19QXb5IXQprOhC4llwzgg bEPhqw7zddxI8EgFCKX4YmxODtldT+32xYL5VDkr9/11ovzAucfyPdGkcVcGv4npf6RA aHTCqoSCBOE2dbxXTa+RLJguhNqDtNIFVg1sXV46RGlCAAzy89xpmexTlLZRI8jYZEgU wbCi2EI+9wUETJJlmjKqFiJagzsxPvx6yUFU9sV81HCKHggvNStgj32Wozapp96QbRk6 rEBA== 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=lfjb2KQKpfPI/NczuRnwqBHpFb27gzw1bs7orOVs/n0=; b=EFrTmywioNHLu+mtm2xVaxSPQfvz2ILp99/Pw4chihyb5UJLItwFx+qKHAr5YFpPB5 M4AYpW8HTOJbo5ZrYWt+ArXPtnYzTpgUxCiR0HPhHsNE6nO0aS4N9cAmyco1gFEUzwO5 w/JSeDw3c5jYCiy/o24IzHr7VhhWE6N8ckeRqUnwBHzJBb2neh0eCzLNI/5XZNftOz7r kUKwCh89fiLquL4IdmVRLGclhGHSLzAiwhst02qW6d1I6UCcpI5CfvsQ3zSmV3DUkdfD j4anjUI7+eSECZmj1g53RkXshsw6tjTflj6/8+7jvTfkWh7wTE1R/rkssT4Ap6hXVtJb I3vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cDP+DEjY; 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 ci1si15759004ejb.3.2021.03.16.23.58.15; Tue, 16 Mar 2021 23:58:37 -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=cDP+DEjY; 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 S231348AbhCQGzL (ORCPT + 99 others); Wed, 17 Mar 2021 02:55:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230500AbhCQGya (ORCPT ); Wed, 17 Mar 2021 02:54:30 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5296FC061762 for ; Tue, 16 Mar 2021 23:54:30 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id z9so507145ilb.4 for ; Tue, 16 Mar 2021 23:54: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=lfjb2KQKpfPI/NczuRnwqBHpFb27gzw1bs7orOVs/n0=; b=cDP+DEjYTO4B8TbudXenl4KxL5PGqLn4iuVMhP4U5nju7spgyO167/kcPJ5Bip6w2T oG96BjQoNj4x8PiD0HanfkIwdA6dHdM8Uot+CRWpHRKby86mX3kUIDDh0OAUKCoY5fpk j6Y0OM7or05cSeNHIWbOOnqXnUu7FPEOVGMJAMDaU6lIhetxfIgE/AlvTpDxC37ksejy /VBDpgjYpGuJOjjw1aWt1fmyg6fKjTjblNkOSPTML3AdjvPNPzS6QFUDigZOoGdsP/l6 seY4s+hQkH3j80VnpfRdD7BVhWRV0adNekDLpby+ukBoX00LXF8QWouyfkUaGKv2KAmc g1xA== 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=lfjb2KQKpfPI/NczuRnwqBHpFb27gzw1bs7orOVs/n0=; b=VT8+xESytdT7+3zdKUrSjb4iL/OE7BUyFeKDBF1pYYBRdnjU9iiv2G71G2/0bwE9mz 9ZyTR7svqZPPFv2geqYhInwmkBOjg2z1e3ulP//LkFdoVZrYB6nrc78haQ4cEEmKtHDd qcE9/emAv70EAmpicZGPE38EToOEwigEutzP2bEWLKYHKii8Le86aGO22vNni9yu3GGm 1BzUznAKmKsaM7JMyV/CqiSbctrR5Q5IEIUqgrsR/utbpLgNx5pZITbJcvgISdOZOGtI zHBVpoDBAh6H9IDXyEozgqWpAAxqMuGCmLsYTlGx0bE6QAznbgRM32Pd3z22QK5NIdiw bIRQ== X-Gm-Message-State: AOAM533dMsD48YCedyo2lW0S635Lq72AgkDtFAwZb+JIJpe8fclov60V /rdBbdxckl8reVtELQLG9qs= X-Received: by 2002:a05:6e02:1aa8:: with SMTP id l8mr6355597ilv.233.1615964069833; Tue, 16 Mar 2021 23:54: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 w13sm10583057ilg.48.2021.03.16.23.54.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 23:54:29 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [RFC PATCH v4 10/19] dyndbg: avoid calling dyndbg_emit_prefix when it has no work Date: Wed, 17 Mar 2021 00:54:03 -0600 Message-Id: <20210317065412.2890414-11-jim.cromie@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210317065412.2890414-1-jim.cromie@gmail.com> References: <20210317065412.2890414-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 Wrap function in a static-inline one, which checks flags to avoid calling the function unnecessarily. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index af9cf97f869b..2d011ac3308d 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -615,7 +615,7 @@ static int remaining(int wrote) return 0; } -static char *dynamic_emit_prefix(const struct _ddebug *dp, char *buf) +static char *__dynamic_emit_prefix(const struct _ddebug *dp, char *buf) { int pos_after_tid; int pos = 0; @@ -655,6 +655,13 @@ static char *dynamic_emit_prefix(const struct _ddebug *dp, char *buf) return buf; } +static inline char *dynamic_emit_prefix(struct _ddebug *dp, char *buf) +{ + if (unlikely(dp->flags & _DPRINTK_FLAGS_INCL_ANY)) + return __dynamic_emit_prefix(dp, buf); + return buf; +} + void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...) { va_list args; -- 2.29.2