Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5594734ybp; Tue, 8 Oct 2019 05:32:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwG3N14bZg4dUhobRnq19YUgT83OeT6HO6XBHaTtOpnfTu+sdSlI0oMikeXFhJXp5ghmpXi X-Received: by 2002:a17:906:b298:: with SMTP id q24mr28402308ejz.168.1570537973479; Tue, 08 Oct 2019 05:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570537973; cv=none; d=google.com; s=arc-20160816; b=e0lqNlHjl0/vtJlTQMz/7DbmgCEhLFEOaGoYj3O3w/F53fWPVRC+2Mly8OAXlzsWHT fqC2pVFVzDVc5Rvl06PCyAo8oc+ildcVZ7mEeVk8Rex7B1O+xY+0ehgn3Cp0fA+kHMRq QOHuGY0wXKUD8oxpv4LG6gfoN5Np1BR/4gFkuH3NxfZ/7Zuy6UIQWGrRl8UBPh8OfuUn PbLiBz96LcbesHA+4oXgH9F0X0LBt470g0TDyMDf30RGv0YqQ6LDXgfWSvqTebSXuNc0 oUmFxM3kuz5Z7nURFG0kUhphoj8jMUTOI58KLBKuU+mSAajZBxGMcQuM37+9YZx95CL+ GVNQ== 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=shR49NxmVmRzjTPJaHTivjYNGPE5YJPsxJZdgJY6iQM=; b=LObOirzpHAD+YChX4dUkbAottF36KB7cmH3l9GqZgv3pOyI3pUgQI1gSChnjiai/mY UXj5GGx9/SfuCW0k+noHbX7GOYMkeN1SGfMA9HlsI71QTYC9XtFZDwBfmrFD9pnS4Apn Su1xlu0XUfKgvhHKQbPF+FDChLs+dEsAc5rDq5Ou5RwjNTkMC3M3W+JSMSDqB1VBTmH3 of89y0UUBsObOvEewrp0hgUpR2oPPcY1h5u4eb5f5D3TTxLKoNbDsq5eoqZLzgsxMhde QFTT4jajDqTtZ06RIqyphSPLwE6ocbjXRFka0d8LFRVP7rBwgAvZBy5QvIQ07hEBchbx hxdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lsDzesG1; 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 i27si8906506ejg.249.2019.10.08.05.32.29; Tue, 08 Oct 2019 05:32:53 -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=lsDzesG1; 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 S1730878AbfJHMcO (ORCPT + 99 others); Tue, 8 Oct 2019 08:32:14 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:56052 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730866AbfJHMcN (ORCPT ); Tue, 8 Oct 2019 08:32:13 -0400 Received: by mail-wm1-f66.google.com with SMTP id a6so2937707wma.5 for ; Tue, 08 Oct 2019 05:32:12 -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=shR49NxmVmRzjTPJaHTivjYNGPE5YJPsxJZdgJY6iQM=; b=lsDzesG1tUV5boM2JpKkMBg+IFseYB8gNMB/2z51TmpVZtOsSvY9QoCHAHg2xVLTHz 4L/OzMarSv26biZjm6lJTIIUKbzUqcC+DISaetXJ+5TQhuxKrUPVujtlT8A8Yptd9Im6 m1XyUCPUkSk1YNzzRWR5e6sn/FlcnhsfWaL7i11yGRo5qt1+a1KGJM++DpPtShOoN7q/ pHsKNRT7WDiUb+8VUBO4W564RWtu19UZ0RJOo83T7Bzz4gi7DQfUVnUdqwjoHycTDLKK cwL0Suha/Ii7w5pamlrveXOVzlUWtl8o6a/V5pORIDIj4w/4DT0VViYdoTgC3hQLbgWC akjg== 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=shR49NxmVmRzjTPJaHTivjYNGPE5YJPsxJZdgJY6iQM=; b=Jwq69196cWCX1WPai10Flea1v8/0fUukcata0+3HFNnY5w+363hSvkDXOjOybN/rYr hVFE1fBbPDdHAwHQx5rh02XLJ9FCTsyLSIKM/B7n5O+OHePrpFlTYfc3zeZqDKMH/IuH Ig5V+Mbjq0uXRpkFXMmqg0hbqGRWoUYZryeF1B+/16Tpt29BVLtpi8z3IuqlFeva6Ewg jsBhrxRGKKfotoYytVY6Ud5HMBdHf3XlwRsRYD8MYX8KRdK4+T57l9igtkn8adqUuBrh FPmxrrzeit82FT35cD2pGsv0Eli+S2hOwd3eA98LifSc4weV8OrxouECp+BwRCqonFe0 vICw== X-Gm-Message-State: APjAAAVQ8p3scyyUWrjjOQXdjfDnw8pY0Bem9yZvAmCYQZI4uHLKVSlu Z81C+qBYeV3aB/+kg/ok4hU= X-Received: by 2002:a1c:8189:: with SMTP id c131mr3601513wmd.151.1570537931475; Tue, 08 Oct 2019 05:32:11 -0700 (PDT) Received: from mail.google.com ([104.238.174.53]) by smtp.gmail.com with ESMTPSA id z5sm32094249wrs.54.2019.10.08.05.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2019 05:32:10 -0700 (PDT) Date: Tue, 8 Oct 2019 20:32:02 +0800 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 v3 0/2] perf: add support for logging debug messages to file Message-ID: <20191008123201.qk5yfeys4ahpjopp@mail.google.com> References: <20191004023954.1116-1-changbin.du@gmail.com> <20191007112624.GG6919@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191007112624.GG6919@krava> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 07, 2019 at 01:26:24PM +0200, Jiri Olsa wrote: > On Fri, Oct 04, 2019 at 10:39:52AM +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. > > > > v3: > > o fix a segfault issue. > > heya, > getting segfault for this: > > [jolsa@krava perf]$ ./perf report -vv 2>out > Segmentation fault (core dumped) > This can be fixed by below change. In this case, log_file is NULL. --- a/tools/perf/util/debug.c +++ b/tools/perf/util/debug.c @@ -37,8 +37,10 @@ int veprintf(int level, int var, const char *fmt, va_list args) if (var >= level) { if (use_browser >= 1 && !log_file) ui_helpline__vshow(fmt, args); - else + else if (log_file) ret = vfprintf(log_file, fmt, args); + else + ret = vfprintf(stderr, fmt, args); } return ret; > jirka > > > v2: > > o specific all debug options one time. > > > > Changbin Du (2): > > perf: support multiple debug options separated by ',' > > perf: add support for logging debug messages to file > > > > tools/perf/Documentation/perf.txt | 15 ++-- > > tools/perf/util/debug.c | 124 +++++++++++++++++++----------- > > 2 files changed, 90 insertions(+), 49 deletions(-) > > > > -- > > 2.20.1 > > -- Cheers, Changbin Du