Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp7397398pxu; Fri, 25 Dec 2020 12:24:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRALCsHdJVosd+HoMnCWuD+vDAYNM+NhrzK40Z3L37dkBBp5g8W5tJp0NopX5p1qe+7837 X-Received: by 2002:a50:9dc9:: with SMTP id l9mr33002954edk.377.1608927840285; Fri, 25 Dec 2020 12:24:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608927840; cv=none; d=google.com; s=arc-20160816; b=gZVZyNKwZty6pJNydZoZyLOe12aa/oKelTjrgB4tKNN+tiUE6FBuhbJKenqaV4uGN5 UxOgQkOHz7Io89E/kwJlEubbOJuNKx92yZwvNCqmEG8/rxwnhrncyRsAM1fjOrCsAR70 6L8wbFLBNQrXK7NCVJ1LPAahdktax0Uajlgtf1nw6lblLqfCKgqk6i6eGIWlUbZMs5dJ TTFt57y0/rYO8Z7xOorNPdTsPcsKBRq6hqBxkGGJcdQR8ifUOWLfALoovfRGK4zdYAEa xvSnPw45qyQ88xyVxZq5zh8rZPaKpJNOMSjEDXM1Dt/Y0NgDQeAdjzB1EfhU17d7gbXn GzXA== 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=sfNgHX3+qK+u0VOsAx/K275yCLCkfDIhGcN/UVgID1U=; b=rDYCe9iJxJtvGEpqtTdtr8zceuaR5l8160k2KqVff4cMFZe0YHkuJ7xcGfMo/lDiPh O0GX6WwW8ESKikFP7LYGbKuePJsfEIdB1hhGPBM88lrVEjLjEpBnFU9UWeFVglyk+qux +q+Lzw10NE5HzDbiSVKHMiMJgbWHaNLx1xvDghXBJv2YAEr4MCFS/NsHct8ECnV0agcG FStNPnrxjrUbgajxUlDObrU1Aa/QOkXOXV1GdXEa/tPDzHPWeHNwOEx/AtSHV/PNUZmL YYKzQi9KlvoanTTbdQWtNtfzX+vDZA4nqmAGGx82/1M4dMfvO0D6x5cjFYScgH0njQut kwgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZAHv7TFc; 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 dp20si14712413ejc.620.2020.12.25.12.23.38; Fri, 25 Dec 2020 12:24:00 -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=ZAHv7TFc; 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 S1729390AbgLYUVk (ORCPT + 99 others); Fri, 25 Dec 2020 15:21:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729361AbgLYUVj (ORCPT ); Fri, 25 Dec 2020 15:21:39 -0500 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E87A7C06179A for ; Fri, 25 Dec 2020 12:20:24 -0800 (PST) Received: by mail-il1-x133.google.com with SMTP id q5so4588683ilc.10 for ; Fri, 25 Dec 2020 12:20:24 -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=sfNgHX3+qK+u0VOsAx/K275yCLCkfDIhGcN/UVgID1U=; b=ZAHv7TFcIx1Mf5mGX+/8xLBwSPzs1ubKMP+G38fFzQQZOShqDkHcHLThvhLJBorgh3 DbzuEXt9OCCXphofuGDl4AstqrTWN8qeehb+BVpflrzKBr/180UAXKczKoijZJHluK2C AFHQhPQWpNqMNKORKduYgQz3qZ4fEKhyK34Dp/wo54v/KNV5etVtI/iLLMv7x22Gw9dM dC4efj1Ou+HvbprRrG9PpU9jE6Bkb2jSt8shNs0WtzkZ1wFCtg37c1emdPyI0t4fgHD0 rn9nzlbR+yE7w2kDjySkGvRjB7A8Q+i6uG9vqJOXj7eh/M8rjGkHykd+PYs2E3l3DfLd UZKw== 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=sfNgHX3+qK+u0VOsAx/K275yCLCkfDIhGcN/UVgID1U=; b=fZJL1U27ZEOzRvHomsuwlDAJiRU4pjJl6SgcRFqEMEajD/MOTYWSLDBSk0MTZ4gr+v BfNQg7NaLOIFkCcTc2m3QgdaNTtM9uDt/SPCGtJwVNegWej0G23nP5jIUvDn/ZfxXJpd iuUNPD3eabpiM3LUx32hfdz9qstfh1TwZdSBYl4FskaMRkMAbMQkZssaJUxTlX3J5YIE WeBTsbKcodrXVlLzEzsXFeh3J2nIPn4E/0kOVxjWZn0XdKXxac3fcu8VlZNzlqQbvYD/ JylAQXWGmE1p9nuh62WUjJYllYrCYp01p3XS6YYbDUbmmeGPiOMJoNRUnuUNYpCqsnTx +fYQ== X-Gm-Message-State: AOAM532faw1w4OhERiuaiffPT3y7o4u++wgsPQxTu2nWcZmtLeXpApmb DMh8oUehZFSu/+89Fg6FW7o= X-Received: by 2002:a05:6e02:10c2:: with SMTP id s2mr33628689ilj.290.1608927624353; Fri, 25 Dec 2020 12:20:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Dec 2020 12:20:23 -0800 (PST) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [RFC PATCH v2 10/19] dyndbg: avoid calling dyndbg_emit_prefix when it has no work Date: Fri, 25 Dec 2020 13:19:35 -0700 Message-Id: <20201225201944.3701590-11-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 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 8e81ce58c1bd..daded73c8575 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -612,7 +612,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; @@ -652,6 +652,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