Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3939850pxj; Mon, 21 Jun 2021 09:48:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyyMxXQIPPzcb5+DqE1nDfsheZHj+/gAT0a79y/xlTdvvStYaTsxRwenXtGFjkHShwRzg6 X-Received: by 2002:a05:6e02:2197:: with SMTP id j23mr4154390ila.159.1624294129557; Mon, 21 Jun 2021 09:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624294129; cv=none; d=google.com; s=arc-20160816; b=okExL3IR4cEh0P/DjCjr/IdVgcV68TeYkHuyLKWb1SrvgUs5hl3NrBhgh3jNiMSxd+ SXe4mlmGSq7wJ6cy3aA1vhb6MLdzSa5kXqfcUt8oTBaBW1QzGNOy2LvgI9aynZwH4bED 2c527EMoKNAdhW2xrWTP9eyRF9Iww1M/yrmYLCCwcfmUDDhjebcqJEWF657ewJAdYSTT 6Z9U8YhWFGQ+0XV5vr+4tYorGJC/w30ClTFNABozcyDGBUH+Px924hTUy7yEkT3bAexs e3bwQueOukeeoen845xbqwinBQolwKFavHiPmAj2ktFpArjQ5vYc05z4YkEZewo/TPPl wYFw== 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=VmhnmL5A9gjxZkmA5sQ9Em5WTaMemqMt8zzNHQ9TVbs=; b=OmnLPgHpQWzPCeXkT0UJGPkR/Vz9LV72mJLR/QxYhoiCuGjaEy0isf/EjYzd2sI6/0 gYwAG6wZ0lQaH9s8QmI6yUW5qDiRioHHLWWIwlc3hq4CeCxTCGyFcfa48UtK8qH9jSdn j80eWzLPtHp/e/uflFTVyOsRZbDbe+X/KRM3iQr5u4Opd05+4lJ/ipa9X3nVFkoIS1jf qAX9yN6xJhd7+RULRbaYhQ+L++XKDP0ZRAMmcG92yQp9DKbqnO6E66c0mI778DNsG+ib 1aJ1m6fU5WUiXxv2kOfVUSVcEhqlKsfGgE48VqkQcrtBVwT6dLhqOWCDb43WbfrWHUZL 3ccA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jnnDqsQF; 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 u18si12788212ilg.79.2021.06.21.09.48.37; Mon, 21 Jun 2021 09:48:49 -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=jnnDqsQF; 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 S233555AbhFUQt5 (ORCPT + 99 others); Mon, 21 Jun 2021 12:49:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:38112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233922AbhFUQpu (ORCPT ); Mon, 21 Jun 2021 12:45:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 879E0613FF; Mon, 21 Jun 2021 16:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624293171; bh=OaR1Sqm2EarsA1kjXI0gsuzqNvi0REyQ7SKT5BuDkn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jnnDqsQF97dKxsdTTK31iyDI7c2Z5spoygAnjLb5Oojfu2NB0Np1erK4trFbgY+e7 +Jw+6gSOge21D9e46UmxnODacBTLDsZrpccdL9ddQhVYLIiXd4F5OMlIhzGSR+apmM IVnW2YKGkWz8W9EJIncly7Adkhg108PCqe/Bq2/o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Steven Rostedt (VMware)" Subject: [PATCH 5.12 123/178] tracing: Do not stop recording cmdlines when tracing is off Date: Mon, 21 Jun 2021 18:15:37 +0200 Message-Id: <20210621154926.956878596@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@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 85550c83da421fb12dc1816c45012e1e638d2b38 upstream. The saved_cmdlines is used to map pids to the task name, such that the output of the tracing does not just show pids, but also gives a human readable name for the task. If the name is not mapped, the output looks like this: <...>-1316 [005] ...2 132.044039: ... Instead of this: gnome-shell-1316 [005] ...2 132.044039: ... The names are updated when tracing is running, but are skipped if tracing is stopped. Unfortunately, this stops the recording of the names if the top level tracer is stopped, and not if there's other tracers active. The recording of a name only happens when a new event is written into a ring buffer, so there is no need to test if tracing is on or not. If tracing is off, then no event is written and no need to test if tracing is off or not. Remove the check, as it hides the names of tasks for events in the instance buffers. 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 | 2 -- 1 file changed, 2 deletions(-) --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2486,8 +2486,6 @@ static bool tracing_record_taskinfo_skip { if (unlikely(!(flags & (TRACE_RECORD_CMDLINE | TRACE_RECORD_TGID)))) return true; - if (atomic_read(&trace_record_taskinfo_disabled) || !tracing_is_on()) - return true; if (!__this_cpu_read(trace_taskinfo_save)) return true; return false;