From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755252AbbHYIKM (ORCPT ); Tue, 25 Aug 2015 04:10:12 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:33190 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754441AbbHYIKG (ORCPT ); Tue, 25 Aug 2015 04:10:06 -0400 Date: Tue, 25 Aug 2015 17:07:06 +0900 From: Namhyung Kim To: David Ahern Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML Subject: Re: [RFC/PATCH] perf sched: Implement 'perf sched runtime' command Message-ID: <20150825080706.GA21465@danjae.kornet> References: <1440483083-19376-1-git-send-email-namhyung@kernel.org> <55DC0900.3010500@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <55DC0900.3010500@gmail.com> User-Agent: Mutt/1.5.23+102 (2ca89bed6448) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, On Mon, Aug 24, 2015 at 11:19:44PM -0700, David Ahern wrote: > On 8/24/15 11:11 PM, Namhyung Kim wrote: > > > >+static int perf_sched__read_runtime_events(struct perf_sched *sched) > >+{ > >+ const struct perf_evsel_str_handler handlers[] = { > >+ { "sched:sched_switch", process_sched_switch_event, }, > >+ { "sched:sched_stat_runtime", process_sched_runtime_event, }, > >+ { "sched:sched_stat_sleep", process_sched_sleep_event, }, > >+ { "sched:sched_stat_wait", process_sched_wait_event, }, > >+ { "sched:sched_stat_iowait", process_sched_iowait_event, }, > >+ { "sched:sched_migrate_task", process_sched_migrate_task_event, }, > >+ }; > > I like the concept (obviously since I have invested so much time in other > solutions). But... you cannot rely on the sched_stat tracepoints being > enabled. I believe it is a performance hit to have CONFIG_SCHEDSTATS enabled > and distributions (e.g., Fedora) do not have it enabled. Yes, I know that some distributions don't enable SCHEDSTATS. But as perf sched record already requires it, I think it's ok to use those events in other sched commands. Maybe we could fix 'perf sched record' not to requires SCHEDSTATS. All commands in perf sched just use stat_runtime event currently. And I guess we can calculate/approximate the stat times using sched_switch events (and wakeup events) only. But it also requires changing other sched commands not to use sched_stat_runtime. Thanks, Namhyung