Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp758264pxb; Wed, 3 Feb 2021 17:45:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyPmKmID5fepsc5ZlP8lMGwtkLNckLRcFuu2yg4KAcQz2mMHBrlUZgaOlFqPAlQ+MBeYEf X-Received: by 2002:a17:907:96aa:: with SMTP id hd42mr5603922ejc.526.1612403112164; Wed, 03 Feb 2021 17:45:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612403112; cv=none; d=google.com; s=arc-20160816; b=y/L8gu1W/4Ku2Zv2QyJHJuVlIoKF35sBsVpM1T3qJmTxLVJ54+skfpISsZ+IJ3CSz7 J+Oxg98uMdV3OW4/05/8ZkMTBwBzSQhil+wypSfhhHbsbd57oS0I/UY1D40nQi404xYf e0+P3EFCH+ZsO346VHWBe8RcedqiGfFt1Z+20yUtA5OQIaxps0inUh3HDd78PCtMirbE NzVRn+nf5dWBEVMhBKUHZUtp341BwXpBG0j7y1YvLoS0a6ZaKDT7CR5RPDa26+Zezqwr HX77qREO4F9h1DWH3OgKaAk7Da1EnygskMCo/BBJ/39enhceoSwwL9lYPfIVWDolLlG1 n75g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fkYIz/77ibQQZH3TPBvrCVM37SX26ohr8olFiL7KaL4=; b=0Shv/bZVi+a/vwHYVSi7YY5jSm3SVr3WPeR76a7zd5ufL3koSU7toMM8nXiKUIrPg5 fi/QJSjhsU/FXZ8CUX8qSlNTk0j83P1ojERPX1CkMipKxnotezba9OynkW82rux/JtKL uZRe+wnWph0rAw/89TR0pgHPOKYag2HYnP86EyIXbWgEeJVmmVEYhz3C+sLKl1kxlxa7 6ZzWEAy5f2DejpXxVj6SS9k94gLPKEOX9Cdfm/DX4GumcpP5vsiA3+FO8zNve8nK+vhz 1StReSTQvZsHSgnr76lBr4WPWyzaQJRXPgQzw+3aHy6oVoHGhOFjN/9Vm6iefDtsFU4/ oCPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E9sSM0fO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n3si2499501ejz.609.2021.02.03.17.44.48; Wed, 03 Feb 2021 17:45:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E9sSM0fO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232757AbhBCU6F (ORCPT + 99 others); Wed, 3 Feb 2021 15:58:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:33688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232311AbhBCU6B (ORCPT ); Wed, 3 Feb 2021 15:58:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C37C64F72; Wed, 3 Feb 2021 20:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612385840; bh=wHYolCFwrPjIfJng82ybYS2z6yvPzx56ne2rU4LE/VY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E9sSM0fOxFH8eHxoaLL9AT4clTus17JXwgCnOcdj6Sp3PkE3LhVZlyn7+vX86o3GA wwQ2N4RG+A3n5y86OkXcfOSbWMg//ZoZzQpg1MtsaqWfS3RgezDnjqvEBtybysumNr T7vULbJ5PZa4z66KeVUdzjlHqBEbtrYwGO66ZGAdPYPoOP/VMaUILAkgR5RTRvfTxK diNnbhjl8lc4VuJTCb28+A7glu8dTX9tqMjmVSC8zE8DXIYMA++s2G/WW1nHjSaj1F J0Fkh+R3dLK2E0yK1TXStdqQpnXZxtg2TJTW5oqTUcxs60c6PD5s3T2JCwGUzkcEeB JKcPRLFH/WuSg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id E641A40513; Wed, 3 Feb 2021 17:57:17 -0300 (-03) Date: Wed, 3 Feb 2021 17:57:17 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Ian Rogers , Stephane Eranian , Alexei Budankov Subject: Re: [PATCH 03/24] perf daemon: Add base option Message-ID: <20210203205717.GP854763@kernel.org> References: <20210129134855.195810-1-jolsa@redhat.com> <20210130234856.271282-1-jolsa@kernel.org> <20210130234856.271282-4-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210130234856.271282-4-jolsa@kernel.org> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sun, Jan 31, 2021 at 12:48:35AM +0100, Jiri Olsa escreveu: > Adding base option allowing user to specify base directory. > It will have precedence over config file base definition > coming in following patches. > > Signed-off-by: Jiri Olsa > --- > tools/perf/builtin-daemon.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) Missing doc update > diff --git a/tools/perf/builtin-daemon.c b/tools/perf/builtin-daemon.c > index 1f2393faad75..8d0ac44ec808 100644 > --- a/tools/perf/builtin-daemon.c > +++ b/tools/perf/builtin-daemon.c > @@ -6,6 +6,7 @@ > #include > #include > #include > +#include > #include "builtin.h" > #include "perf.h" > #include "debug.h" > @@ -15,6 +16,7 @@ > struct daemon { > const char *config; > char *config_real; > + const char *base_user; > char *base; > FILE *out; > char perf[PATH_MAX]; > @@ -38,6 +40,7 @@ static void sig_handler(int sig __maybe_unused) > static void daemon__free(struct daemon *daemon) > { > free(daemon->config_real); > + free(daemon->base); > } > > static void daemon__exit(struct daemon *daemon) > @@ -47,6 +50,12 @@ static void daemon__exit(struct daemon *daemon) > > static int setup_config(struct daemon *daemon) > { > + if (daemon->base_user) { > + daemon->base = strdup(daemon->base_user); > + if (!daemon->base) > + return -ENOMEM; > + } > + > if (daemon->config) { > char *real = realpath(daemon->config, NULL); > > @@ -109,6 +118,8 @@ int cmd_daemon(int argc, const char **argv) > OPT_INCR('v', "verbose", &verbose, "be more verbose"), > OPT_STRING(0, "config", &__daemon.config, > "config file", "config file path"), > + OPT_STRING(0, "base", &__daemon.base_user, > + "directory", "base directory"), > OPT_END() > }; > > -- > 2.29.2 > -- - Arnaldo