Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2606034ybj; Mon, 23 Sep 2019 06:37:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8qd4sMVOcV0Nzu1SDCSoSyoZOZ+ZrKwGLi8yyhy5lDwcv9b05kOu+OZi0ndf9vKlXx8h9 X-Received: by 2002:a17:906:6084:: with SMTP id t4mr29401814ejj.164.1569245838428; Mon, 23 Sep 2019 06:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569245838; cv=none; d=google.com; s=arc-20160816; b=peVUWM6bpftuI/hz6eFsfVOe+p6N2UiuPRMXm1zzFmNsyIB4PAUYagqwz3bictnjQZ tXHVGWQ4wYTOsrNW4xXtEoHUHATtLY5dL/aZyNRjFlEyD2QFPIj20aZBmdxElhkSqhmO FOFVxaTIxeGuq1UoPAXe0wSej/gjxiGPsvts92AyRLY0vu72Nx6SSm+Jpk3VrxOURORg +6v6OTsSZmt98IEyDyHUMgFCXBzQFp4EYJ9KN5jVLclT0L/Tzk3zW0yAv57GRoSoxseN i2Jb/EgXZdAXzKh578B7gglZtmquoJ+nFr6aURcCY4MNh6C5K1++hWUGNcSCdkfjfCQS akMA== 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:dkim-signature; bh=4HorIcxvAeYR90hn18suy/4zO4DegTzvuyZdzOASANM=; b=FnnKiYZ9h5uUmzqjoi5c0aSuqDiRetHWyr1wfrYtdE0qWimcRHJ8uOUoMbwMKgVSwa r3tQ1MQ1PEPPHKvPESSeIxUpeR+Q2sHuPufk6XUXhKx+cfpuwtDrhIt6vu9hWZhx9paL JW2ZfOrMFOSTlQebXp0o3XEZd94z3OGaatiYuKkeMaOPZhySp2y12YxzcvHEuKpAeEcD xziHAbMU84IUwxC4T/mbjmpHKRZl/vHZRkOs+hhr4eLR/btncTOjT65k5GT8XNw9rGlN 9jzYFcI1Um+Noh6kI2lP6LZ4qLiFX04vgHsBngYmY8S1UPEAtD9UPPEzmj7PJJ/yBCwd Tj8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="r4zN/DrZ"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18si7295862edb.155.2019.09.23.06.36.54; Mon, 23 Sep 2019 06:37:18 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="r4zN/DrZ"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437622AbfIUCEu (ORCPT + 99 others); Fri, 20 Sep 2019 22:04:50 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45502 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437587AbfIUCEu (ORCPT ); Fri, 20 Sep 2019 22:04:50 -0400 Received: by mail-pl1-f194.google.com with SMTP id u12so4023924pls.12 for ; Fri, 20 Sep 2019 19:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4HorIcxvAeYR90hn18suy/4zO4DegTzvuyZdzOASANM=; b=r4zN/DrZc8ATtRCTZ92cWaGhlPyXK2A8r2K59trA4kT/Fjfwbda3rsFDb885kkj0hu JUHiKmg3Uhgif2wsoPG0mFobB3MnUH8HH0jqc/zvdmhOWPb7lfmi0JJgPSrb1EzRNXCs +dwKgyWaECDAbIEitn2szBynKUz+kPpa5ZKkJ/kHd73PTO6VElNeyKn7xQ9fCPjK+QeO GQ4FtDH4hnacidh9hwM7bXZueI5BRusFW2OyTo8KTnc7vCWXB60B4heybW/oo/ZN/Vuz QYrPvCo/R1LaAptvrX7cggHW9fEZ9f4zDEGcr7EBO9f9uTuhPNyhbO/xl/g61I3+QTLa y1cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4HorIcxvAeYR90hn18suy/4zO4DegTzvuyZdzOASANM=; b=EuThMphlBkZXNYxL9XyNUEu9p9jDdeEKDjo/lD2OG5Io2VUZM7+CAn4NSPbENJxWsD t1i0ozHeat2JJtbnb9AHsDcwxg1m7Lt/RrjdhIToEvRSKKPYPRNl/Cx4wWLF0uiEseVE CmpkZrtbaJNk+U07zWXDq/715HpOQ86tB+axLIK0GPLSFFEqdoNXRup3vzzcCjajeqJ5 QZhq8QWYSKn5dacx0mjMdqnGyoGJ0lInKpC79+jv5iQjSbJaJUQPo5AIEtnzSkKgwldf QrN7YCuxBzKWJDdm1hiddI6tsu6YPd3IUpdDigca2Oke/P4S+NGNOOxVOGs60t3u+gmI 5xZg== X-Gm-Message-State: APjAAAV5dY5Bl6dU6Hl3jth4QZ2n6QM4IWHQmVVTwnlG11DBPrHypCwC wmWvikl/5hzELD5HiZZnJME= X-Received: by 2002:a17:902:8a81:: with SMTP id p1mr19531274plo.71.1569031489622; Fri, 20 Sep 2019 19:04:49 -0700 (PDT) Received: from mail.google.com ([207.148.65.56]) by smtp.gmail.com with ESMTPSA id d24sm3825652pfn.86.2019.09.20.19.04.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Sep 2019 19:04:49 -0700 (PDT) Date: Sat, 21 Sep 2019 02:04:45 +0000 From: Changbin Du To: Jiri Olsa Cc: Changbin Du , 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: <20190921020444.qtrsqxweuyoeomzq@mail.google.com> References: <20190915102740.24209-1-changbin.du@gmail.com> <20190920205356.GA1041@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190920205356.GA1041@krava> User-Agent: NeoMutt/20180716-508-7c9a6d Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 20, 2019 at 10:53:56PM +0200, Jiri Olsa wrote: > 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 > This could be done, but first we need to change the option parsing code first. will do it later. > jirka -- Cheers, Changbin Du