Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3919393pxj; Mon, 21 Jun 2021 09:22:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk7+zSGJShLUF/K/P+oj2e8W5elpoIJHkBpSy6ZGfiwM6qFwo19H4dUAWD61r63zoXHzj+ X-Received: by 2002:a17:907:1b29:: with SMTP id mp41mr25962036ejc.459.1624292541449; Mon, 21 Jun 2021 09:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292541; cv=none; d=google.com; s=arc-20160816; b=1A1hdxr0Ba+aWLGhzPtx85CWSGpJACjzn27iwb7b5zwFVEUZzxAk1vu5Lb6P+/+NfK 6UwNZLbqSILxisykCV3PMDXRakU8RidMEv2t+RCR22DwtvvbPE6jyWq5s6FOELnXvsHL Gbnspcv6Vlvs3eBt+75p0aEw5PiMseaKGvAxmBq9OPbr/vi/vYftcb0Us2DcKOjwQU/1 F2oHhd1H3Eqn8+Dv1gKNlYkqrWn6FSoyjW47wMV7dLaqQv2IxY7IbT/efrpyRr/Vf2IH soHPDPi7eslUNtf7GoOyt8PqEUNi9Xmd0J60qNU2E4Vr6CWRHw5w1XeFY7PRbfZ4VZXm VCOg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=74QQTVAHQ8HKPHA5jRHTk6nDjQFEcm3PHheMu05E3Jc=; b=JX+KQ4fLjwF3L8AzljePtJlppCcYf3O6IjgjXOqMkWstsc8ZfX3GBJV2Qktb+XvM8b BPP50Wyztyvg17q0a7ss+tbx0ejCtfKoxwA8YwfqW/ZIDqsaqNUBiJ5YLrEw8J3RPZ1s Pgs14Q7CiGjWlAjNcXhxXyDdA/PngWjfjMhEfs1NggUodgjSgGwdDgpRx6LOLLXGfhap Ekphxx0Ih/HaE0vjhMwcb+gkNWCpxUJrcvxp4mKKjBXs9AyOpCRm/kQQeS3VVKC0mtXq +IRWGwTyvGSxQArfM4HN1YfVfWqI0i/O/4JqZLTL+oXqe2X7yWp9P40dhCI+AkZnA5D8 uX/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PcTkBO+C; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb10si11383637ejc.344.2021.06.21.09.21.58; Mon, 21 Jun 2021 09:22:21 -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=@linuxfoundation.org header.s=korg header.b=PcTkBO+C; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231924AbhFUQWa (ORCPT + 99 others); Mon, 21 Jun 2021 12:22:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:40508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231169AbhFUQVS (ORCPT ); Mon, 21 Jun 2021 12:21:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 12E2761164; Mon, 21 Jun 2021 16:19:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292344; bh=FAkSYqFfFnVQkOIYEvmy4UTRP3DWfQSBA4Q2+Z0e23c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PcTkBO+CQVOHCtKW/TQks1yj4SDdhVC98voCTXfS7tfE67DR7XoyRLl+OXuB4Rs+x q0OoGbLhzQRY1IslMXQ6hI3Jy6idYYP8DM6oZI3y670JSfvJV/uNr+ek3NFh1ZgStA dq0lDuyzT3jXoEBSBpSkx6QGJGcGM0BkPS+aVStQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Steven Rostedt (VMware)" Subject: [PATCH 5.4 56/90] tracing: Do not stop recording comms if the trace file is being read Date: Mon, 21 Jun 2021 18:15:31 +0200 Message-Id: <20210621154906.050692153@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154904.159672728@linuxfoundation.org> References: <20210621154904.159672728@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steven Rostedt (VMware) commit 4fdd595e4f9a1ff6d93ec702eaecae451cfc6591 upstream. A while ago, when the "trace" file was opened, tracing was stopped, and code was added to stop recording the comms to saved_cmdlines, for mapping of the pids to the task name. Code has been added that only records the comm if a trace event occurred, and there's no reason to not trace it if the trace file is opened. Cc: stable@vger.kernel.org Fixes: 7ffbd48d5cab2 ("tracing: Cache comms only after an event occurred") Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace.c | 9 --------- 1 file changed, 9 deletions(-) --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1948,9 +1948,6 @@ struct saved_cmdlines_buffer { }; static struct saved_cmdlines_buffer *savedcmd; -/* temporary disable recording */ -static atomic_t trace_record_taskinfo_disabled __read_mostly; - static inline char *get_saved_cmdlines(int idx) { return &savedcmd->saved_cmdlines[idx * TASK_COMM_LEN]; @@ -3458,9 +3455,6 @@ static void *s_start(struct seq_file *m, return ERR_PTR(-EBUSY); #endif - if (!iter->snapshot) - atomic_inc(&trace_record_taskinfo_disabled); - if (*pos != iter->pos) { iter->ent = NULL; iter->cpu = 0; @@ -3503,9 +3497,6 @@ static void s_stop(struct seq_file *m, v return; #endif - if (!iter->snapshot) - atomic_dec(&trace_record_taskinfo_disabled); - trace_access_unlock(iter->cpu_file); trace_event_read_unlock(); }