Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1411694ybh; Sun, 19 Jul 2020 19:23:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRy8o38FJQPezlgVtvS0EivILgBTcpaQtyH082Qk2X2VQQ7KRw6Q3KSec2IM+ybw0Clr0c X-Received: by 2002:a17:906:fa15:: with SMTP id lo21mr19833006ejb.156.1595211789987; Sun, 19 Jul 2020 19:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595211789; cv=none; d=google.com; s=arc-20160816; b=QuVMSVL1TnO0PM+0gXdwjAx71p6jDS9hYQbdffu9+T0r9El6iByTbtxesR06mzEueF 6Z6Zwun866Y2l/Q8UMl2xWt842hWiNaeA+4j7whYSBri7m1e6RClckRFKxUI1xB7ZwAb Li0TmyV+rIW7m+5evSWKepvQ1z9owgW05pkuoNZCDw5WqEhdCRJPrppEjSmFuUtHlo3m tSHeOBeX5w1G1KwhmQVZpUAGxiwgl9psKZtaprW1RnKxgIzEtR5W7b7YC00Fyafn9aHy OMzq4yrE3aZL89E4FSh1xTkXcpmq4j2Psx5fl8dgshNoCI5Tx7GLyrHSg8bk4tZfGD+1 uQQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=QCeLGXUUJPDQeHoRFw7rlWyuXvEvFyGagkbQpzgobm4=; b=ytJ7I9tkguiZr7VISJWsYUndvjC7Uhn7y3d+YeNJ2jKP3nWSj4XJOjWDOZ5rjWKm9I Q5CMeBM4pzYNI3uWqWs7daA/8eXpa674bDnhBUMeNzQRdrbcn6Uj/6g/96fUSpB2H5aC Yq8EVaDU8PFLVEH3t2dsCeufWcMWVIYopQ3jTsDWwvZAG5BbaTkDyGfsA5jl422IVvvW QevjkhnHSJIwNku+/1kB23C1ScY16pGD3yLdYSsZY7lSHy5b6SQz2D+fj6WccLbI2buD GC+Kt+lxtPaebHKfbPUssD1IGMIt/xxvugOyrRacTvQ+AOMi+o5eXYIBz6CT9jvKtyJy Hbkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=RzwVEkbt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t24si9637341ejr.733.2020.07.19.19.22.47; Sun, 19 Jul 2020 19:23:09 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=RzwVEkbt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727033AbgGTCVy (ORCPT + 99 others); Sun, 19 Jul 2020 22:21:54 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:21224 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbgGTCVx (ORCPT ); Sun, 19 Jul 2020 22:21:53 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1595211713; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=QCeLGXUUJPDQeHoRFw7rlWyuXvEvFyGagkbQpzgobm4=; b=RzwVEkbt/uBJSyNwBo0nU7Zk/ebl/GJM+mvmXXXRRK/S8FuNwO6PQdzHSuIcNUH63dXWtTNg 9xmEL6IJ7UotneQ+ZwzzF/j3Az8HCDoCMIyLRpQr7bg7zxzkmx3EMSmy97zzyw8JoIbxVzFD 8+AR6M/qfOXqugYAbYqHhQxLe8c= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n16.prod.us-west-2.postgun.com with SMTP id 5f14ffb0166c1c5494558285 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 20 Jul 2020 02:21:36 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 77192C43391; Mon, 20 Jul 2020 02:21:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from tingweiz-gv.qualcomm.com (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tingwei) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7C295C433C9; Mon, 20 Jul 2020 02:21:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7C295C433C9 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=tingwei@codeaurora.org From: Tingwei Zhang To: Steven Rostedt , Ingo Molnar Cc: Tingwei Zhang , tsoni@codeaurora.org, Sai Prakash Ranjan , Mao Jinlong , linux-kernel@vger.kernel.org Subject: [PATCH 2/4] tracing: add trace_export support for event trace Date: Mon, 20 Jul 2020 10:21:15 +0800 Message-Id: <20200720022117.9375-3-tingwei@codeaurora.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20200720022117.9375-1-tingwei@codeaurora.org> References: <20200720022117.9375-1-tingwei@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only function traces can be exported to other destinations currently. This patch exports event trace as well. Signed-off-by: Tingwei Zhang --- kernel/trace/trace.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index bb62269724d5..aef6330836e2 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2697,17 +2697,6 @@ int tracepoint_printk_sysctl(struct ctl_table *table, int write, return ret; } -void trace_event_buffer_commit(struct trace_event_buffer *fbuffer) -{ - if (static_key_false(&tracepoint_printk_key.key)) - output_printk(fbuffer); - - event_trigger_unlock_commit_regs(fbuffer->trace_file, fbuffer->buffer, - fbuffer->event, fbuffer->entry, - fbuffer->flags, fbuffer->pc, fbuffer->regs); -} -EXPORT_SYMBOL_GPL(trace_event_buffer_commit); - /* * Skip 3: * @@ -2868,6 +2857,19 @@ int unregister_ftrace_export(struct trace_export *export) } EXPORT_SYMBOL_GPL(unregister_ftrace_export); +void trace_event_buffer_commit(struct trace_event_buffer *fbuffer) +{ + if (static_key_false(&tracepoint_printk_key.key)) + output_printk(fbuffer); + + if (static_branch_unlikely(&ftrace_exports_enabled)) + ftrace_exports(fbuffer->event); + event_trigger_unlock_commit_regs(fbuffer->trace_file, fbuffer->buffer, + fbuffer->event, fbuffer->entry, + fbuffer->flags, fbuffer->pc, fbuffer->regs); +} +EXPORT_SYMBOL_GPL(trace_event_buffer_commit); + void trace_function(struct trace_array *tr, unsigned long ip, unsigned long parent_ip, unsigned long flags, -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project