From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5866F14A6C9 for ; Mon, 11 Jul 2022 08:52:40 +0000 (UTC) Date: Mon, 11 Jul 2022 10:52:36 +0200 From: Kamil Konieczny To: igt-dev@lists.freedesktop.org Message-ID: References: <20220707065939.33453-1-zbigniew.kempczynski@intel.com> <20220707065939.33453-4-zbigniew.kempczynski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220707065939.33453-4-zbigniew.kempczynski@intel.com> Subject: Re: [igt-dev] [PATCH i-g-t 3/6] tools/lsgpu: Add codename switch (-c) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On 2022-07-07 at 08:59:36 +0200, Zbigniew Kempczyński wrote: > Add -c switch which will change default (pretty) platform name to > codename only. It may be useful for writing device selection filter. > > Signed-off-by: Zbigniew Kempczyński Reviewed-by: Kamil Konieczny > --- > tools/lsgpu.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/tools/lsgpu.c b/tools/lsgpu.c > index 27e76f2616..da84e20505 100644 > --- a/tools/lsgpu.c > +++ b/tools/lsgpu.c > @@ -73,6 +73,7 @@ enum { > OPT_PRINT_SIMPLE = 's', > OPT_PRINT_DETAIL = 'p', > OPT_NUMERIC = 'n', > + OPT_CODENAME = 'c', > OPT_LIST_VENDORS = 'v', > OPT_LIST_FILTERS = 'l', > OPT_DEVICE = 'd', > @@ -88,6 +89,7 @@ static const char *usage_str = > "usage: lsgpu [options]\n\n" > "Options:\n" > " -n, --numeric Print vendor/device as hex\n" > + " -c, --codename Print codename instead pretty device name\n" > " -s, --print-simple Print simple (legacy) device details\n" > " -p, --print-details Print devices with details\n" > " -v, --list-vendors List recognized vendors\n" > @@ -163,6 +165,7 @@ int main(int argc, char *argv[]) > {"sysfs", no_argument, NULL, 1}, > {"pci", no_argument, NULL, 2}, > {"numeric", no_argument, NULL, OPT_NUMERIC}, > + {"codename", no_argument, NULL, OPT_CODENAME}, > {"print-simple", no_argument, NULL, OPT_PRINT_SIMPLE}, > {"print-detail", no_argument, NULL, OPT_PRINT_DETAIL}, > {"list-vendors", no_argument, NULL, OPT_LIST_VENDORS}, > @@ -177,13 +180,16 @@ int main(int argc, char *argv[]) > .type = IGT_PRINT_USER, > }; > > - while ((c = getopt_long(argc, argv, "nspvld:h", > + while ((c = getopt_long(argc, argv, "ncspvld:h", > long_options, &index)) != -1) { > switch(c) { > > case OPT_NUMERIC: > fmt.numeric = true; > break; > + case OPT_CODENAME: > + fmt.codename = true; > + break; > case OPT_PRINT_SIMPLE: > fmt.type = IGT_PRINT_SIMPLE; > break; > -- > 2.34.1 >