From patchwork Thu Oct 20 14:06:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Chen X-Patchwork-Id: 6216 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp135883wrr; Thu, 20 Oct 2022 07:16:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75me1xd3/5hiBxU1qaBGc50DCB+AQdM5P/1XUuSFVinrkEDbhX758OVIEd5s0F8ufYXQdf X-Received: by 2002:a62:e40d:0:b0:563:44d8:c6d1 with SMTP id r13-20020a62e40d000000b0056344d8c6d1mr14656677pfh.53.1666275393575; Thu, 20 Oct 2022 07:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666275393; cv=none; d=google.com; s=arc-20160816; b=u/wUTKFwUNMxNpHjLPvx9LRUYdP0oGvxhNM0wk5jL5r5irouYzTu8glps5hpyABDgh J/ZAgGcmcs0n7ZO263TUfdivr7kqXWR/dy5YyEUsDefULmwOCdiB7po/5t6yjpLXAV1m nvbbmFNsIzqURj/L7Qfx4HJg3nIZS+y4k1O21+wnp15ZtiK8lrhp/OIImDkHnQvrMCLM APUwsaT+ZtwAXvoq1ZoyW/yIjLkE5H4CtYPchmVysZ9EIIr2ti8ekD1gXOTBWDAAqkj7 fieEmg7IJUCaP+H1mavaiElYvEVXu8rzD8/ccHsbgcPkwg6R/YFnztz24UNlthcf695B WtMg== 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:sender :hmm_source_type:hmm_attache_num:hmm_source_ip; bh=B6PJJLP9tXZWVauDQgkEhWFj0d4BgulinrAbzspp0O4=; b=NwxbxB4GFzCXWjJD2AdZeYhmPD5VUZASOP7ySh6e/NtZvOed6e2LxFOEInLGfM8hGd zdLQzYwvgaMMivdXrX05Qz05nyX5MQkg4iRWzFAbwEm1Zv92rr3SVQPGBHrMQ+Gjq6mL kDGGU6Vpbbg54I2nC/JYsJepALETTLooidJR5xGQ6Rs7PYM5wEdbTFhTOiDrgkylwjeT hrQfanfWucKvgQs9otnuxMapLHp0ND8EdAWuBu2bxXOGkHXXfjh1Ms4SV6DDW/DSQJl+ BM7x8FmSUP6wIZjWWcVqT+eUwNr94ePjvGFFRhSCxy1azSvKgDyue6iCc2ko/ZmesjaH zQUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h62-20020a638341000000b0046b2bed9c97si20083031pge.757.2022.10.20.07.16.06; Thu, 20 Oct 2022 07:16:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229720AbiJTOHC (ORCPT + 99 others); Thu, 20 Oct 2022 10:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbiJTOHB (ORCPT ); Thu, 20 Oct 2022 10:07:01 -0400 Received: from 189.cn (ptr.189.cn [183.61.185.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 005D017F2B6 for ; Thu, 20 Oct 2022 07:06:58 -0700 (PDT) HMM_SOURCE_IP: 10.64.8.43:57690.1101889674 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-111.162.158.155 (unknown [10.64.8.43]) by 189.cn (HERMES) with SMTP id 53D711001F5; Thu, 20 Oct 2022 22:06:55 +0800 (CST) Received: from ([111.162.158.155]) by gateway-153622-dep-787c977d48-59pdt with ESMTP id ca9f54f5c31540bf998ead0613fb6c18 for rostedt@goodmis.org; Thu, 20 Oct 2022 22:06:56 CST X-Transaction-ID: ca9f54f5c31540bf998ead0613fb6c18 X-Real-From: chensong_2000@189.cn X-Receive-IP: 111.162.158.155 X-MEDUSA-Status: 0 Sender: chensong_2000@189.cn From: Song Chen To: rostedt@goodmis.org, mingo@redhat.com, mhiramat@kernel.org Cc: linux-kernel@vger.kernel.org, xiehuan09@gmail.com, Song Chen Subject: [PATCH] trace/ring_buffer: remove unused arguments Date: Thu, 20 Oct 2022 22:06:51 +0800 Message-Id: <1666274811-24138-1-git-send-email-chensong_2000@189.cn> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747216387464020493?= X-GMAIL-MSGID: =?utf-8?q?1747216387464020493?= As a argument, event has nothing to do with either ring_buffer_unlock_commit or rb_commit and cleaning it up has no side effect. Signed-off-by: Song Chen --- include/linux/ring_buffer.h | 3 +-- kernel/trace/ring_buffer.c | 12 +++++------- kernel/trace/ring_buffer_benchmark.c | 2 +- kernel/trace/trace.c | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index dac53fd3afea..a1483e5dd846 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h @@ -113,8 +113,7 @@ void ring_buffer_change_overwrite(struct trace_buffer *buffer, int val); struct ring_buffer_event *ring_buffer_lock_reserve(struct trace_buffer *buffer, unsigned long length); -int ring_buffer_unlock_commit(struct trace_buffer *buffer, - struct ring_buffer_event *event); +int ring_buffer_unlock_commit(struct trace_buffer *buffer); int ring_buffer_write(struct trace_buffer *buffer, unsigned long length, void *data); diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index d59b6a328b7f..fbadfeff6542 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -3088,8 +3088,7 @@ static inline void rb_event_discard(struct ring_buffer_event *event) event->time_delta = 1; } -static void rb_commit(struct ring_buffer_per_cpu *cpu_buffer, - struct ring_buffer_event *event) +static void rb_commit(struct ring_buffer_per_cpu *cpu_buffer) { local_inc(&cpu_buffer->entries); rb_end_commit(cpu_buffer); @@ -3298,15 +3297,14 @@ void ring_buffer_nest_end(struct trace_buffer *buffer) * * Must be paired with ring_buffer_lock_reserve. */ -int ring_buffer_unlock_commit(struct trace_buffer *buffer, - struct ring_buffer_event *event) +int ring_buffer_unlock_commit(struct trace_buffer *buffer) { struct ring_buffer_per_cpu *cpu_buffer; int cpu = raw_smp_processor_id(); cpu_buffer = buffer->buffers[cpu]; - rb_commit(cpu_buffer, event); + rb_commit(cpu_buffer); rb_wakeups(buffer, cpu_buffer); @@ -3892,7 +3890,7 @@ int ring_buffer_write(struct trace_buffer *buffer, memcpy(body, data, length); - rb_commit(cpu_buffer, event); + rb_commit(cpu_buffer); rb_wakeups(buffer, cpu_buffer); @@ -5877,7 +5875,7 @@ static __init int rb_write_something(struct rb_test_data *data, bool nested) } out: - ring_buffer_unlock_commit(data->buffer, event); + ring_buffer_unlock_commit(data->buffer); return 0; } diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffer_benchmark.c index 78e576575b79..aef34673d79d 100644 --- a/kernel/trace/ring_buffer_benchmark.c +++ b/kernel/trace/ring_buffer_benchmark.c @@ -258,7 +258,7 @@ static void ring_buffer_producer(void) hit++; entry = ring_buffer_event_data(event); *entry = smp_processor_id(); - ring_buffer_unlock_commit(buffer, event); + ring_buffer_unlock_commit(buffer); } } end_time = ktime_get(); diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 31dd208a3d4e..d79d1a341f38 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -999,7 +999,7 @@ __buffer_unlock_commit(struct trace_buffer *buffer, struct ring_buffer_event *ev /* ring_buffer_unlock_commit() enables preemption */ preempt_enable_notrace(); } else - ring_buffer_unlock_commit(buffer, event); + ring_buffer_unlock_commit(buffer); } /**