Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp343100pxk; Thu, 3 Sep 2020 00:45:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwejm9RrM3+/MkuH/6sNwAob2JnItmyoMdTEUWvsablfw8dIYOao8TVvnqXsKf1LNkegkcI X-Received: by 2002:a05:6402:3102:: with SMTP id dc2mr1821588edb.152.1599119155863; Thu, 03 Sep 2020 00:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599119155; cv=none; d=google.com; s=arc-20160816; b=02Ae2dPmE+fzpRfm9pKYkgbsT/9u8sv2kBiGvBUJYz1OkpTo6dAmfaIgVkdDbrSfzw jhZ0jZ4D1KjWyToIzklgRO1MNyavjZugoc7b03RiTzcrUpcN9ECDJEmTnGLPI9+dqXnQ x6fkZQsfLP/0YyOI2I2NSEoq+AxDwAs20ArJh7LW5CyRqfgIemnqRcLR1TQWLIDd0KHy pZ/GwC6cJosC/NShPgTRY6R/7M5vw4tughiMZXa4tz9Pq1u5TZxqxRbcOVafvYKTQ+r+ iG/I7W7K2wTTTWcRHaHloI6aLBK5qM4mrEZz+C/ZjEn2yu/AtePYuPI5DIQjAQrn+JmV qD1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Z2zwM95IPgkBTO4Wu24eSib0PZAEqyn1hWAVi1nsOs4=; b=CXvKlmx1hS21Xr31kYValJqGdwKNKKylB6fldFHw1oC8ei0Oz0UsxdrtyYBjlz6WCQ cA3EgFKUp7F3Zz+wpmaNZI2fYo/a/QBPhDgA69+cXCh6WmIjD2Al4yZ4mVpuFfn/sucg aFbbhVDd4GH4QDoGDAe7Zinxd8CN9mDw/WAqBDsw+fOA4rCqEQeEmxkII8SiXiUftf94 /rYtUTBMPw1ZV7WAAATB3r6tvST5txchMu3j0QLbVVD7GSMLTK2pgNM/g+ScVjZyPk/6 c7XkDlHo+dh95szJYGV4vQsy9uhrEvEc5aYu6lVRdoSBqX6BjKMYtrHnmfQrpiYlo70Q SL/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b="Pq/NRTih"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v16si1714514ejk.147.2020.09.03.00.45.30; Thu, 03 Sep 2020 00:45:55 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b="Pq/NRTih"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728015AbgICHnA (ORCPT + 99 others); Thu, 3 Sep 2020 03:43:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726814AbgICHm7 (ORCPT ); Thu, 3 Sep 2020 03:42:59 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 206B2C061244 for ; Thu, 3 Sep 2020 00:42:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Z2zwM95IPgkBTO4Wu24eSib0PZAEqyn1hWAVi1nsOs4=; b=Pq/NRTihLN/0dCTzX1OI9MU8Qn c7PIiE+l3F9wOM/AQkH8r7vCZZDIn2pgJujY8OAsPkbl1cAYeNtnzn910H5Lauzz6gK4ERMWEdN07 Z1Moel7PFytIenNbJXLvy/iWlmWdJdOvLgks4SThyuUvVQrWnyMZwh8jgp184HTwGeT0NTFw/rCxR kTsXLip0/2mcSutpCXqraZS2RTv3bHM+Cuupd3aTw8wqqsiZdZn6foENJTufF4RmUmeyFCngbflke /BtCV4Kn5ardkZlq1n3CPuas2YOegYcX94hZc+NNMtbWc7Tv3ElQfYGxqmhyLlvwmKCX2tRaIHqOf ifvAjQpg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDjtB-0005Px-VY; Thu, 03 Sep 2020 07:42:34 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5D6843012DF; Thu, 3 Sep 2020 09:42:32 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 39B922BA41930; Thu, 3 Sep 2020 09:42:32 +0200 (CEST) Date: Thu, 3 Sep 2020 09:42:32 +0200 From: peterz@infradead.org To: gengdongjiu Cc: "mingo@redhat.com" , "juri.lelli@redhat.com" , "vincent.guittot@linaro.org" , "dietmar.eggemann@arm.com" , "rostedt@goodmis.org" , "bsegall@google.com" , "mgorman@suse.de" , "thara.gopinath@linaro.org" , "pauld@redhat.com" , "vincent.donnefort@arm.com" , "rdunlap@infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: =?utf-8?B?UkXvvJpbUEFUQ0hdIHNjaGVk?= =?utf-8?Q?=3A?= Add trace for task wake up latency and leave running time Message-ID: <20200903074232.GW1362448@hirez.programming.kicks-ass.net> References: <6995260be2ca4fd18bc773fe9f50f420@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6995260be2ca4fd18bc773fe9f50f420@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 02, 2020 at 10:35:34PM +0000, gengdongjiu wrote: > > NAK, that tracepoint is already broken, we don't want to proliferate the broken. > > Sorry, What the meaning that tracepoint is already broken? Just that, the tracepoint is crap. But we can't fix it because ABI. Did I tell you I utterly hate tracepoints? > Maybe I need to explain the reason that why I add two trace point. > when using perf tool or Ftrace sysfs to capture the task wake-up latency and the task leaving running queue time, usually the trace data is too large and the CPU utilization rate is too high in the process due to a lot of disk write. Sometimes even the disk is full, the issue still does not reproduced that above two time exceed a certain threshold. So I added two trace points, using filter we can only record the abnormal trace that includes wakeup latency and leaving running time larger than an threshold. > Or do you have better solution? Learn to use a MUA and wrap your lines at 78 chars like normal people. Yes, use ftrace synthetic events, or bpf or really anything other than this. > > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c index > > > 8471a0f7eb32..b5a1928dc948 100644 > > > --- a/kernel/sched/core.c > > > +++ b/kernel/sched/core.c > > > @@ -2464,6 +2464,8 @@ static void ttwu_do_wakeup(struct rq *rq, struct > > > task_struct *p, int wake_flags, { > > > check_preempt_curr(rq, p, wake_flags); > > > p->state = TASK_RUNNING; > > > + p->ts_wakeup = local_clock(); > > > + p->wakeup_state = true; > > > trace_sched_wakeup(p); > > > > > > #ifdef CONFIG_SMP > > > > NAK, userless overhead. > > When sched switch, we do not know the next task previous state and > wakeup timestamp, so I record the task previous state if it is waken > from sleep. And then it can calculate the wakeup latency when task > switch. I don't care. You're making things slower.