Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp135148pxb; Thu, 2 Sep 2021 00:13:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyu8rROmxt0gA7yfGk1P6LNuGpjo+jNFpfbiHFS7OggEJVbz1kVzAGCXt66kR30aPS262L X-Received: by 2002:a17:906:1913:: with SMTP id a19mr2246761eje.390.1630566782848; Thu, 02 Sep 2021 00:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630566782; cv=none; d=google.com; s=arc-20160816; b=JcdmBEzd+pMO+G2HWe4r4zlvfyybjWo3fhia6QytXxFSEn/1+8BT7cTcTSsHCB0maU KyAnxrpGLAw7FHGR4yBYTafc/1Xwsw2KfhaP71AuuiZ8DkundrFN5W4Ys0Ya+1A7R8ab zAGhzD+CKoRTU7h4KNGqdIyyTheF50FWbB/GaWX7uX4mm+yTN6CsjFnAa9B+piD5cDzS DjbRDhq2UjA8I2b6gdlGmCCtPNm9udgbMoNyeoz9vFa7z0rjeXJWTXrrebMLp6ul0u+A 9CVNrkNas0ZZ4TbMcSxopyDkEoN4JLbLKWuw/xVvvpE81E4ZpIZzVCH+3otLiJrUuBhv X76Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=B9VnMmf96yIaoNmVdOAODl2Xr6QOvqTnZJWE41I2JSw=; b=F3rRAx6TQjsoCfXmGa0nFqMTOoMcuKb+tjnLdaHArE5b8SA8xXbuRlGCajkBLu5f/3 uam4ldckCEObHVYY2vzbmpJwwHAwrbC4ACye9D1dC03vVxtnyr3s1Gvq/b4GJwEsKNrG r2RYJHGPOpUyFAx0SKI03G/+ZwWiIUIBMvyG8EX6oUg24JzJyqfINH9SMdZRlK044DSD lvDrJWxLjfOzQE4nXegBJVi67h5RY2R2esMHcv3L6fy9eY0V9dSlEdUH1bg77RsPhg7J nxQm22AUAOvWmS6heWsVsHhPLhMsK/fgBh+3lRz8xeCW1pLvntYdNhs1HNn4jLU1+JKE kjvQ== ARC-Authentication-Results: i=1; mx.google.com; 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 b1si1283669edy.360.2021.09.02.00.12.28; Thu, 02 Sep 2021 00:13:02 -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; 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 S242637AbhIBHK2 (ORCPT + 99 others); Thu, 2 Sep 2021 03:10:28 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21]:46898 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S242504AbhIBHK1 (ORCPT ); Thu, 2 Sep 2021 03:10:27 -0400 Received: from localhost.localdomain (unknown [124.16.138.128]) by APP-01 (Coremail) with SMTP id qwCowACnlNKSeDBh4Ic9AQ--.4291S2; Thu, 02 Sep 2021 15:09:06 +0800 (CST) From: jiasheng To: linux-kernel@vger.kernel.org Cc: jiasheng Subject: [PATCH 2/2] tracing: Add trace_trigger_soft_disabled() in front of trace_event_buffer_commit() in trace_inject_entry() Date: Thu, 2 Sep 2021 07:09:03 +0000 Message-Id: <1630566543-598084-1-git-send-email-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: qwCowACnlNKSeDBh4Ic9AQ--.4291S2 X-Coremail-Antispam: 1UD129KBjvJXoW7JF4DJry7tF1UJw4xuF18AFb_yoW8JrWUpw nxKr9xKrW8Ja12g3WxuF48GryUZ397tr9rJFW8G343J3s8CrnrXFZ2qFn8Z34Yyw48J3ya yw1jyrW7CrWUXFJanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkv14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26r xl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVAFwVW8 CwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r 1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxkGc2Ij 64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr 0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6r4j6FyUMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF 0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUIApnUUUUU= X-Originating-IP: [124.16.138.128] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We have found that in the complied files trace_event_buffer_commit() appear more than 200 times, and under at least 90% circumstances that trace_trigger_soft_disabled() and trace_event_buffer_commit() appear in pairs. For example, they appear together in the trace_event_raw_event_##call() of the file complie from 'include/trace/trace_events.h'. But we have found that in the trace_inject_entry(), there is only trace_event_buffer_commit() instead of the pair. Therefore, we consider that the trace_trigger_soft_disabled() might be forgotten. Signed-off-by: jiasheng --- kernel/trace/trace_events_inject.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/trace_events_inject.c b/kernel/trace/trace_events_inject.c index c188045..6dfd3cd 100644 --- a/kernel/trace/trace_events_inject.c +++ b/kernel/trace/trace_events_inject.c @@ -21,6 +21,8 @@ trace_inject_entry(struct trace_event_file *file, void *rec, int len) void *entry; rcu_read_lock_sched(); + if (trace_trigger_soft_disabled(file)) + return written; entry = trace_event_buffer_reserve(&fbuffer, file, len); if (entry) { memcpy(entry, rec, len); -- 2.7.4