Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3928790pxj; Mon, 21 Jun 2021 09:34:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkrAWOuzlHwB1ZBxK2yUc2btCeXplS+QpZh23K7iIJPGZWkeZga0qptDELQhJ7hV6Q4VKs X-Received: by 2002:aa7:da8a:: with SMTP id q10mr16266490eds.81.1624293262926; Mon, 21 Jun 2021 09:34:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293262; cv=none; d=google.com; s=arc-20160816; b=Ky38kFMMoV4TR+iekwDUjiHydi50SRHiEa0DEywWU6qxg3yPuHu6wHeMq14WYe37RJ xqJUGuqpc6HzaiaNxITV5+mF+czNIERTNOcz77ur+q0zxa0eQBfmLVPae2M90QLaPY97 Mi/dpVp1zHoX5Pdqp/7FqYKP7FNEB5PFx9iTRAu7zxralvZglwuCrn1Io9BIS8T+iXWi NGjt2YKKFb5iCDtAGZOh+ADgDAG48Vg4D01tL3mUuS6IKU1SknZRTTleXveSvEoDsCZN cHDdqNRCWPd3EYFPNBgWZjE4ck71/zsxZnZ2m7iSi1x8rX6guiHHxHQA2ISg0GUmjgfq v9mA== 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=fwESau7psHbfv2pzqGQG+K3gWYWi3E+IPCHw70MUiZ4=; b=EyrLoAO7yn3valDMwotY8ulEuHuVAcI7yIxWx/PY7EOCGS/vVvmAlENHESbrBMM5wB 3jp+03PBweCTs4dDduaGbyzAUyoX9Gx7Ab7FZjYmRlgQagaKia5IAMI2S/tJSqwX91S0 yISJ1ALJ8fVBOEVPXAZhr46a5918Cw7NfTml/VFUngXq/tSyyaL10YHt3KJsYFPCLOiI WAnPXzbnSVh/UPJVHCWR2Q8xLTYvIXrFlwcl/4Z/bRuoDzyFVSpst0CUdmOhTAcAHHo+ YwtfZvrEC/xFJZwMOR/MWEvMPuVIL/Bpo6tWBQPR3RmGc9w6Hxpehae4BwkX+tLgfYCV PXkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EmfGvHcM; 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 hs7si8603626ejc.659.2021.06.21.09.34.00; Mon, 21 Jun 2021 09:34:22 -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=EmfGvHcM; 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 S232609AbhFUQeO (ORCPT + 99 others); Mon, 21 Jun 2021 12:34:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:53734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232095AbhFUQbI (ORCPT ); Mon, 21 Jun 2021 12:31:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CC9E961374; Mon, 21 Jun 2021 16:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292722; bh=3WLRSUuOqhh2D7yVmOIgvNWkOBe+BWyLkKxjq9Bh8d0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EmfGvHcMJi0nOv74NwCbCBOQCYWI+i4lffHk5lcUyiD7RWFgDOjiW01nycHXJCrPF JSq77TFu9N2HfnXP8R1+vRRcwzfr+zUAxk7BxyT2sa3iG2Fb6GfJuier9qkxRziy7e 42rjFRAHsQskzJmZgbz5BeDzZiOuGcSlCauJjNqY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Steven Rostedt (VMware)" Subject: [PATCH 5.10 105/146] tracing: Do not stop recording comms if the trace file is being read Date: Mon, 21 Jun 2021 18:15:35 +0200 Message-Id: <20210621154917.937095026@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@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 @@ -2195,9 +2195,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]; @@ -3683,9 +3680,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; @@ -3728,9 +3722,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(); }