Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp61305pxj; Thu, 20 May 2021 04:36:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoYyQgSpvQy/Zf6R5Bo8XehgjuKuoGAbXWzwwH0NTtc90KuhZjL37UcQztP1Bui4KhC3so X-Received: by 2002:a17:907:10ca:: with SMTP id rv10mr4189375ejb.377.1621510561865; Thu, 20 May 2021 04:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510561; cv=none; d=google.com; s=arc-20160816; b=XdVQwxNoxTcEwaDMdFoGNSJpg+1tWruq1eSnBhuCdrTHxH+pMNTctg3/gM2w47XoYo wG2ti1Rxsr5k3pBWUYY9NbaBnIv/pxa29mcBRADQmGp3qJVBFI/AI0Wt67LGp2dk8tw+ buxxwjjGHGoamSg9vTZaegqtrmAEir7j0SGmqLpy2N4F5vc4fm5Mnap/dpBL5fgEeR6t dU9Q1tweYsMbrXvIOyOQWeLTyBppFcBKBL4JHpds9TACthG0fVds59WNwR1rJdGop7XE Y+ftneG2nOJwnF1jn3hzMWctNbaMzrF+LFeyUMYLUd6aObXVegH7UmbQyTvkN1Wg2s35 /Rbg== 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=/1OcPYTDJSoxy8PXQdpCjTAYgvtxsstzdM8VyugLLr0=; b=FLe1KPmSMMmKc3t5/5Yqvvlts587I/WrSpjVAONrC2xj1viJLR7HLqRPpI1DlCn/T5 vvqhQcLnFQ7+0Mpo+NxFEssaNlxTo6qVmRTaHN+ePNTY8jXVcPsMHHCBrRDqAwO8pWUg 46knqZS3ekcWAitIqG4LQoXsO4lAnO1PBXaKtciKqVaZVQSXKQcMy2LgeFjclK/RMQXI 2h8IYjnFZwOLEKRQIzyWrQc2BCHk6HOt/hwkVqio41+5EQnTpBhEkMmIHTrfsd3MO4/5 cheL4AaRZyAqP9Rv+igNgwXbFGeBSAI05WvV5345+xIK9MdeoNaJnbM99vSi1eP0ZTGS u5WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y7mvKluY; 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 r10si2480447ejy.100.2021.05.20.04.35.38; Thu, 20 May 2021 04:36:01 -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=Y7mvKluY; 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 S241479AbhETLd2 (ORCPT + 99 others); Thu, 20 May 2021 07:33:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:53584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239439AbhETLNC (ORCPT ); Thu, 20 May 2021 07:13:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BC09761D57; Thu, 20 May 2021 10:07:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505278; bh=8LgiR+npoFqEB1JNgPzV+J/DXcKVw+ekEdRPhgyEXis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y7mvKluYaaxd7zwaeb+wPrx4Vkw46wZmeA/fPMKR1ueVLk57rgkKW0PeELAXHKGIX ri86acKxpAWwlXdWytnngPWf9q3bw2n1ihOJR34vN+1l7KrmTGhqBCS04MqjDBm0h4 cEGzzVKaazNKpW6F6G3r+TfOayL+SvZagqRwu9II= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel-team@android.com, Ingo Molnar , Michael Sartain , Joel Fernandes , "Steven Rostedt (VMware)" Subject: [PATCH 4.4 062/190] tracing: Treat recording comm for idle task as a success Date: Thu, 20 May 2021 11:22:06 +0200 Message-Id: <20210520092104.215509374@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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: Joel Fernandes commit eaf260ac04d9b4cf9f458d5c97555bfff2da526e upstream. Currently we stop recording comm for non-idle tasks when switching from/to idle task since we treat that as a record failure. Fix that by treat recording of comm for idle task as a success. Link: http://lkml.kernel.org/r/20170706230023.17942-1-joelaf@google.com Cc: kernel-team@android.com Cc: Ingo Molnar Reported-by: Michael Sartain Signed-off-by: Joel Fernandes Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1564,7 +1564,11 @@ static int trace_save_cmdline(struct tas { unsigned pid, idx; - if (!tsk->pid || unlikely(tsk->pid > PID_MAX_DEFAULT)) + /* treat recording of idle task as a success */ + if (!tsk->pid) + return 1; + + if (unlikely(tsk->pid > PID_MAX_DEFAULT)) return 0; /*