From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48813C3A5A2 for ; Fri, 20 Sep 2019 20:54:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 168F32086A for ; Fri, 20 Sep 2019 20:54:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387762AbfITUyA (ORCPT ); Fri, 20 Sep 2019 16:54:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49570 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387431AbfITUyA (ORCPT ); Fri, 20 Sep 2019 16:54:00 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA80F10A8121; Fri, 20 Sep 2019 20:53:59 +0000 (UTC) Received: from krava (ovpn-204-16.brq.redhat.com [10.40.204.16]) by smtp.corp.redhat.com (Postfix) with SMTP id C07FA60606; Fri, 20 Sep 2019 20:53:57 +0000 (UTC) Date: Fri, 20 Sep 2019 22:53:56 +0200 From: Jiri Olsa To: Changbin Du Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Namhyung Kim , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: add support for logging debug messages to file Message-ID: <20190920205356.GA1041@krava> References: <20190915102740.24209-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190915102740.24209-1-changbin.du@gmail.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Fri, 20 Sep 2019 20:53:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 15, 2019 at 06:27:40PM +0800, Changbin Du wrote: > When in TUI mode, it is impossible to show all the debug messages to > console. This make it hard to debug perf issues using debug messages. > This patch adds support for logging debug messages to file to resolve > this problem. > > The usage is: > perf -debug verbose=2 --debug file=1 COMMAND > > And the path of log file is '~/perf.log'. > > Signed-off-by: Changbin Du > --- > tools/perf/Documentation/perf.txt | 4 +++- > tools/perf/util/debug.c | 20 ++++++++++++++++++++ > 2 files changed, 23 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/Documentation/perf.txt b/tools/perf/Documentation/perf.txt > index 401f0ed67439..45db7b22d1a5 100644 > --- a/tools/perf/Documentation/perf.txt > +++ b/tools/perf/Documentation/perf.txt > @@ -16,7 +16,8 @@ OPTIONS > Setup debug variable (see list below) in value > range (0, 10). Use like: > --debug verbose # sets verbose = 1 > - --debug verbose=2 # sets verbose = 2 > + --debug verbose=2 --debug file=1 > + # sets verbose = 2 and save log to file it's variable already, why not allow to pass the path directly like: --debug file=~/perf.log would be great if we won't need to use --debug twice and allow: --debug verbose=2,file=perf.log jirka