Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2349150ybj; Mon, 23 Sep 2019 02:12:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWP5hC+whhlmBeI45veXNN5lvdEiOid2+34YF7zJbypkzYDts9iMl+idrDH1ol1+4AAz/k X-Received: by 2002:a50:f045:: with SMTP id u5mr35730438edl.297.1569229936730; Mon, 23 Sep 2019 02:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569229936; cv=none; d=google.com; s=arc-20160816; b=ljc3c6AW/VU+3Ckq0VAtzVKoQ1iE1Ktifgk5BmzQ54zC3Zo8ZbQsB9S1bjm8/hpxm3 IWn2Fb8V9XHLKfKHvRDcV0gCbsDhHhmeXu3Jj+J2yHCq80IpIjSCDKo1QGC+VNfsERWq uUGQuYq7Vg1l8q7OCT52LDajbJm1mVERq1C613YW+JkZCZ5OdhHmQeNonI5PK0M/hZsT 1VVUP/sWSDXsCafomIaiNh43ZLDFYggVFO4T5EXUH78P6ayCYfhAVmXuyoc6omWf48Ut pvY3llXDtiARKpv42ycuukC8jtERI3r9KzGHmFE+XE/D6/CkIMaVKz4R9TxnSkvcEo3K zrXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mICWa6LgiE3wPN8uA0taML1NnxbF0HsWrRrNjhpJCak=; b=q3Y64AdaLieF7OsLYi/YcOkZJfKyTqQSTMnmt8i1xn+tqK5hzowxdEZAXBMqD8q9qs QLnLFeC+UCMT03cUt6j+CSXCXcpC6I7bzG9y2oeSKfhgItGxLIe9jejunVjLPTmW+F+R fGrfl3ZMffNuFX29cdvLyy2NlKUfausoKUG2ArpLOWdsYqnH2NKuHza4WVJgqGG3HZv/ cOMB/8i8W7+GEWXUnzI9+3fOR27P/KIyN2Xtr+HvCf7+ky8NRKbzQ6uozPEMoLOw58tA FSwKcAUsBedY9w6llidFGuvHaWoLF2eHqVnjr5dJ9ZsfGnFkHbnUnnhtKGjYC6GbKUQV I9gQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10si4595761ejf.69.2019.09.23.02.11.53; Mon, 23 Sep 2019 02:12:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387722AbfITUyA (ORCPT + 99 others); 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