From patchwork Sat Mar 1 00:01:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduard Zingerman X-Patchwork-Id: 13997240 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88E946FB9 for ; Sat, 1 Mar 2025 00:02:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740787336; cv=none; b=d8oS2dODHgeQZgFD1UTKse/mhs9YSKPCZThvOAmNjIAjC2H39Fhpig/obhVsArrVaMSCJ5tOTbRyltfXimth80XdaVX9218QzfDMzs9SzPe/nEvbfxEaYezfWaYEAB6ShMAe8vjJuaMJtUCnB52IqLZ70QyAvmckD9hPSSe0vNc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740787336; c=relaxed/simple; bh=puRsiwHLnojWnbkcRvaAb0rKnH6aG37O6flpB1aAkoM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TnObWyBTc1m0Cp9eBZD8qU32mjsxAKalhme64Ud/eQWC2Uv0Qco63gNaJlyk6G+7/Q/Vo6BkTJZL5Zh9VfA4jX7397dNRkiiu9Wgig16iOz6UPw1zE8Dfb5X56hvr029bR+Zct5c7/MsqtteaADK+3qpo1iCaZAz9BzhV0Tt9JE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=J6H8fEcg; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J6H8fEcg" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-22334203781so59313455ad.0 for ; Fri, 28 Feb 2025 16:02:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740787334; x=1741392134; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7k8ov3nANh8MH1vRD2IZ+9DmKZthAkyrs1EFG01JfAI=; b=J6H8fEcgplsS6nTx5c8nJX8yWyZYy9yaWyQWR2brbzX8cu8oGyomgfEPWneq36XhZx T+J8MO388UO1hD08WqECFPXidle98DiYt8354VMEQR6bcJW3YZqN36e3Ovrv89XBsu0m ToGWHxFFavFbAPGuxbOcrsK/Em1XEfUd5BJk3uMPHrWS4hZMfuGFrMkfMtloagSrnCRD vwF5nGjWTL2lZHfGIh/x9xKDVaCuqjsJYnxJTj7RCtp3ICFD3eqwFTxaW6Zf6VyrUlbM j4Vho2hgFucpMdBg5H7coZy0iOi5TDXZsET2hkrouCAurbov6wpXqS2tEyJznd83kMOQ 0ldQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740787334; x=1741392134; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7k8ov3nANh8MH1vRD2IZ+9DmKZthAkyrs1EFG01JfAI=; b=T7Zvg+WoXThsABcagQm7+gXNdy6P1WrsNTe9jFjHrpbnsdBp0YRi+smaZsHcwnDLdT jHC+LRaDhYmeJ/NfZU73ciZ9kx96Gug68MSzYaowKreb8KgISOmtPegGyveXwBbLX+X3 qb3z1SuhxlLJwFZL3nTKOsZoriC1h2oFfpGO5uFtC0cqbtEffQfSz+U3IVoLOcHpwLM4 X3A7O4WJHDByip/ngKlwSENBW22PjLMtpHlxAYTx8bp3uCEIN3hFgLBSvI0ZQC/KreVx neLs8lQk/rMYkE3385mStyPTcFcCqcHmPh1UcTGS8zLpjhhw02+LKz1mrF+BIZY6p+If mPAg== X-Gm-Message-State: AOJu0YypwJ+E8wAU2FbN8VENaQU8Ju7YzzZoEV2U6P+Hbk0XmhDv6Ftu xfmVvohNMjKYq/i4/v4iuR0pkdj+pv5do64gFn0Lii/lKMinPvWkS+loxA== X-Gm-Gg: ASbGnctCvGaE2m3Q09o49fsRLYmJn2yo/zByDty2iOIqGcI4ve5o8S4B6ShVMBK0EHF 8jZnfkmWAjnBP5tULTCxv1ON8mun57fyrl3tbiu2utY0f/C1+Vnyh5pKcbwm2eK2A+ymBNl3xtY OyWypgPjXtS01XtS8buDMJmjsLCuFKBsT+0fuS/wanE7GNbfZ6hMbDfXXuk5RR00dk80hqMhEIO FYguJyl2lVGPgYC5yVSXrXH3gKgd1pLGh5dfCc8IdBIajAtHkzaUtM7u6pluNWgxbcFnOB+PBqc w4T6F7jF+NzEPI9JJwu1UYbMoOqV74IVpUiPfpYY X-Google-Smtp-Source: AGHT+IF8FEh3yrIj71h/wE77qPiIIXc3XtkRrsa3Vl7GZRp02CQL/udbco12tYF206PbNrhyFfcpuw== X-Received: by 2002:a05:6a21:999f:b0:1e1:f88a:3106 with SMTP id adf61e73a8af0-1f2e38759demr14882966637.7.1740787333648; Fri, 28 Feb 2025 16:02:13 -0800 (PST) Received: from honey-badger.. ([38.34.87.7]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-aee7dedf5a8sm3993425a12.70.2025.02.28.16.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2025 16:02:13 -0800 (PST) From: Eduard Zingerman To: bpf@vger.kernel.org, ast@kernel.org Cc: andrii@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, kernel-team@fb.com, yonghong.song@linux.dev, Eduard Zingerman , Mykyta Yatsenko Subject: [PATCH bpf-next v2 1/3] veristat: @files-list.txt notation for object files list Date: Fri, 28 Feb 2025 16:01:45 -0800 Message-ID: <20250301000147.1583999-2-eddyz87@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250301000147.1583999-1-eddyz87@gmail.com> References: <20250301000147.1583999-1-eddyz87@gmail.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net Allow reading object file list from file. E.g. the following command: ./veristat @list.txt Is equivalent to the following invocation: ./veristat line-1 line-2 ... line-N Where line-i corresponds to lines from list.txt. Lines starting with '#' are ignored. Acked-by: Mykyta Yatsenko Signed-off-by: Eduard Zingerman --- tools/testing/selftests/bpf/veristat.c | 62 ++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c index 175a03e6c5ef..8bc462299290 100644 --- a/tools/testing/selftests/bpf/veristat.c +++ b/tools/testing/selftests/bpf/veristat.c @@ -268,10 +268,11 @@ static int append_filter(struct filter **filters, int *cnt, const char *str); static int append_filter_file(const char *path); static int append_var_preset(struct var_preset **presets, int *cnt, const char *expr); static int append_var_preset_file(const char *filename); +static int append_file(const char *path); +static int append_file_from_file(const char *path); static error_t parse_arg(int key, char *arg, struct argp_state *state) { - void *tmp; int err; switch (key) { @@ -381,14 +382,14 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) break; } case ARGP_KEY_ARG: - tmp = realloc(env.filenames, (env.filename_cnt + 1) * sizeof(*env.filenames)); - if (!tmp) - return -ENOMEM; - env.filenames = tmp; - env.filenames[env.filename_cnt] = strdup(arg); - if (!env.filenames[env.filename_cnt]) - return -ENOMEM; - env.filename_cnt++; + if (arg[0] == '@') + err = append_file_from_file(arg + 1); + else + err = append_file(arg); + if (err) { + fprintf(stderr, "Failed to collect BPF object files: %d\n", err); + return err; + } break; default: return ARGP_ERR_UNKNOWN; @@ -689,6 +690,49 @@ static const struct stat_specs default_output_spec = { }, }; +static int append_file(const char *path) +{ + void *tmp; + + tmp = realloc(env.filenames, (env.filename_cnt + 1) * sizeof(*env.filenames)); + if (!tmp) + return -ENOMEM; + env.filenames = tmp; + env.filenames[env.filename_cnt] = strdup(path); + if (!env.filenames[env.filename_cnt]) + return -ENOMEM; + env.filename_cnt++; + return 0; +} + +static int append_file_from_file(const char *path) +{ + char buf[1024]; + int err = 0; + FILE *f; + + f = fopen(path, "r"); + if (!f) { + err = -errno; + fprintf(stderr, "Failed to open object files list in '%s': %s\n", + path, strerror(errno)); + return err; + } + + while (fscanf(f, " %1023[^\n]\n", buf) == 1) { + /* lines starting with # are comments, skip them */ + if (buf[0] == '\0' || buf[0] == '#') + continue; + err = append_file(buf); + if (err) + goto cleanup; + } + +cleanup: + fclose(f); + return err; +} + static const struct stat_specs default_csv_output_spec = { .spec_cnt = 14, .ids = { From patchwork Sat Mar 1 00:01:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduard Zingerman X-Patchwork-Id: 13997242 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 259968F7D for ; Sat, 1 Mar 2025 00:02:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740787338; cv=none; b=d7FtXVOPW37I2mv3fCPdf6zy5Z2dutVTBnAZL2dKOKY9vPe1IKrOUyGYytS8c/J1MnRpZMJaz3wp1Mte0BRmp6JzMN1rv6D66ZqCHp32tEfnM8+RM/j7mWErl4x6epHMRD+SyDGy9BtatTB0VU0YJj9/9vugGAxFrMhAmZ2ZIIo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740787338; c=relaxed/simple; bh=Lm4viNS9jwfLfzS56hnv533rHZTR8IK56cgoJU17C4A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F/ywhmlF235mZ17huY4CWzDfXkiKsd5j1BsuRPBRU1S61J4CyB6SXBrG8j2STwKzkjW32zisUioEG+mMIS3GDAHo4QcS+72j0FEa5+87DyheuBKbR7ShmBBSV/GBe0VDYTpZQqq+OfqQFbwk8y/IJ7gkvxR6SJNXIsilT+gSq1k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KwHQTiDR; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KwHQTiDR" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2230c74c8b6so6554095ad.0 for ; Fri, 28 Feb 2025 16:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740787336; x=1741392136; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sRDOSr0U5aPeieQz4ZJr7W8hqZ0x548srBPd1IK4uoI=; b=KwHQTiDR6UqQzyBkLGo02XJOHlk2Ly8rHvgMwEjYW8HeewY4DqA+u5NrdNqAxHOy/C rh7SLWovUhrz/kRdfogfyLlNZQFXL1rEUUIeKTjQPGIMCOWOGi9/cYbnbh3YBBrdsg2V MjI9X8myiRDYba746pKyiToUBaubuawaG2ZLPlp/73tprRZXp6HJbbDUFyKGa4K8qAfp pDlU1erRv38Bm/fNixS/LFpKox4agKiMCCb5/2wFqbjhIv2I0OOq7jFmAgFefSwzqtHN zH53jcfj96XIynUlHDogQlJ4ZdO9fdx2tIwEYyF3puXucOZmAl7rS/hM4DnFEygRlTdb t/oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740787336; x=1741392136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sRDOSr0U5aPeieQz4ZJr7W8hqZ0x548srBPd1IK4uoI=; b=wTTBEU2o6aFIJ+05SrYN4tZiYMAFlbBbQfZCaL5eiCCTAE8MeoCzT8h2P5ZK37ko6F dvJ9NS56YXFeyTL1Dsu3bQUpOivyC0zqQ8LLPIh7VuYf2SfMSNmfmKOhHz4J0qu3uubR f/7E23z/bXhgb/tTFNZQ4Ifq4tY7BA8w0EIQbcfRXGAF0T1qdKveo85ZIQZ7DTFcbwT+ 8D+s7vctCxzTsf/LtjmjI0SjkKBrfYBER11sB/hqP0pHvAxEVl0NPqaYgQJOB2aGcG4f I2Dmh6Io9ObIqCmG1cjNJwGd7wdHU5YC3b6O2qKolaYkaOEZWmWuOnznccCoWOCpUIdF 1yEw== X-Gm-Message-State: AOJu0Yx+FFoCuBh996PgHG+k/1PxBR+YdkBL9BOo1pgyMpPocCOX806H +8h42eLDHQSw2FNVs1eFKYp39ZA5kztqckgsf49mOsW5PAU+F8Ei6mPnTA== X-Gm-Gg: ASbGncsuuOUOreXSP7xh/qkRjoYGabqrPjoLX/PH39KCN3euVFhxedXk3CxtZrvTLJ3 spIGj8hjatJpat2OOs4+aTBsEY8exhfgUQBdiVt2D4H2SjUSZEzhdv9IGJWLSYF7EdX+btlMijF udcOKKh70Dntzv9KRsAsyvYGRSzF2o5/n6gGv2lunaFefypBtSTF3922oU2qxliEI8ZYjwz+D13 YT5/jQd4OqdJREm+vDOfbOJcEops2x5pNDBdVEymzvwLpTBAwnKsUTFePofJEcUuoUT78ja7Ys5 OIRYPE9KLgCgGcQwtLhnW5ArmQ5oDLdCRqjQli+K X-Google-Smtp-Source: AGHT+IEQu5rQWp1WFv2cZao+zs3sKaNamyJO5/gts5u/DD9JM4C91+1DU52Mr6HePsdoZzEL88ad5g== X-Received: by 2002:a05:6a00:1395:b0:736:34a2:8a18 with SMTP id d2e1a72fcca58-73634a28a41mr1491473b3a.24.1740787334680; Fri, 28 Feb 2025 16:02:14 -0800 (PST) Received: from honey-badger.. ([38.34.87.7]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-aee7dedf5a8sm3993425a12.70.2025.02.28.16.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2025 16:02:14 -0800 (PST) From: Eduard Zingerman To: bpf@vger.kernel.org, ast@kernel.org Cc: andrii@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, kernel-team@fb.com, yonghong.song@linux.dev, Eduard Zingerman , Mykyta Yatsenko Subject: [PATCH bpf-next v2 2/3] veristat: strerror expects positive number (errno) Date: Fri, 28 Feb 2025 16:01:46 -0800 Message-ID: <20250301000147.1583999-3-eddyz87@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250301000147.1583999-1-eddyz87@gmail.com> References: <20250301000147.1583999-1-eddyz87@gmail.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net Before: ./veristat -G @foobar iters.bpf.o Failed to open presets in 'foobar': Unknown error -2 ... After: ./veristat -G @foobar iters.bpf.o Failed to open presets in 'foobar': No such file or directory ... Acked-by: Mykyta Yatsenko Signed-off-by: Eduard Zingerman --- tools/testing/selftests/bpf/veristat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c index 8bc462299290..41dfcb6f5690 100644 --- a/tools/testing/selftests/bpf/veristat.c +++ b/tools/testing/selftests/bpf/veristat.c @@ -660,7 +660,7 @@ static int append_filter_file(const char *path) f = fopen(path, "r"); if (!f) { err = -errno; - fprintf(stderr, "Failed to open filters in '%s': %s\n", path, strerror(err)); + fprintf(stderr, "Failed to open filters in '%s': %s\n", path, strerror(-err)); return err; } @@ -1422,7 +1422,7 @@ static int append_var_preset_file(const char *filename) f = fopen(filename, "rt"); if (!f) { err = -errno; - fprintf(stderr, "Failed to open presets in '%s': %s\n", filename, strerror(err)); + fprintf(stderr, "Failed to open presets in '%s': %s\n", filename, strerror(-err)); return -EINVAL; } From patchwork Sat Mar 1 00:01:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduard Zingerman X-Patchwork-Id: 13997241 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73DDD23F399 for ; Sat, 1 Mar 2025 00:02:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740787337; cv=none; b=K/Z7jA8A7BQE5KNcXhqxmjWQP3qxTmpDGZmefQhlfbXy9YFpb4G78EQ/aw7wR3QLLxG1QpYgIDovPWkXUACfkXvxrDLgDMQc7o/u/zpR7zsnfLYM+KctV1pmbn/GEhjrjIIR6bTPZ0aNzHzXAgW9cvcgzJP7+iQrCUEf7qhhcm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740787337; c=relaxed/simple; bh=wCITQNvqfhoeKlNMmQPgk8ObVKLQLcrqoMuH1n92puY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oWVQItajH1+NPtVwFvB0XWmiMqTVYE0dljb9bovFJHUCfqkKezGMTEtb+TeRXxMzBbFQ+YT04yce3ZtsC5XVMoBpeN0ab5Zv4SV1WL7yLVEmZOUGvPiYUeT21EyZ05kmk3xumBUlrTp0zcPggcpu8B6HDlv8FtQzgDp3YYDwOmw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TrdZwLnF; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TrdZwLnF" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2230c74c8b6so6553865ad.0 for ; Fri, 28 Feb 2025 16:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740787335; x=1741392135; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d4BrRbkfHH7UOUxrf/eNy7zq1XLAGTtKKtshvdCxU8U=; b=TrdZwLnFxz5dt467GdKOuspilbNeqvQIIK3SMn7Q99+zSex9CTKvBp310cbie27Ttc CMEcsfpyqyTdPJJHQah1SPQNZViVVFlgGf+gjiK2yJs9Y4ZNIrZsUfX5mK3WnDJmHjMS GjHn2XJASvYWjX+KQHI2P0hHxBDz4VYc8mPfcLzEtJzfWBQekvlYGpBgPG3DvGB09MKt Q7fsrozwc6JEZSaJ/dyKByZVMjGKNvy4A+s3da+DnK9DzaR2ZMKjeR+EXfB+Qfgb2yUH yAgiYFfS+2haGNFVLe1IDmdRPbYa/3aOFFkho3IuWvKpV8kKKGwL2Z9WmPMqoyP2+9fk ucPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740787335; x=1741392135; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d4BrRbkfHH7UOUxrf/eNy7zq1XLAGTtKKtshvdCxU8U=; b=WZniLNXMRGVoGMQ96HWVSRG+shVKAJ4fIYl0CMK1SaOlSd7vXerw3KcbPM57mPjY7k Pv+SdmvdsK4+EJTZ0CY3S0UW3wPjzMhNS89BP9uKHwGflQk4BqVBo63n/NDcoRR0BwCc QS1ZCOoxbtLJktBVdmtv3s5+yerFlAfN2+a8RTZW0uHzC7Gqrhco2dB+hlUP6E14lWNr 76VQs/z1nyC/Z+xOkTH+w7AYOfdsUThmmmlKaJG3wZBn8w/B5OJdaj1h4MMVY8oLSt/o hf4v69wZzDFhsOxQCgmdMpVc0JfqdXNkfwy6uhoi4cPatkGheoSmehVKx/pPI86ICJxB /jlQ== X-Gm-Message-State: AOJu0YxOTxnoXfiHnmfyRtVXiJSizJ/HPxSOJ1G9WpWSuhQFsc0yhfCN vH45L3oYHYHIUxL+x23qKwWe3WAkynGFh7HPRp3qjsgGVvkgb1MJjNqrkQ== X-Gm-Gg: ASbGncvdhlwFaLjEQL2V2yAKm5eyT01t7CHBLbpsGD4VQQWMoEZxM+xLPpW6tnj6V5G t/f8taoAW74PEBZN9p2thT9VBo140UA/J3r7cv3TewdAlWOYcWsjI0rwB7JdiomTmygdOnt0tQj yC+R7KWHny4pIJ3giBTmXc2HmprybuSeRxmzTaoHTxoLCrFeREBIeDKQVBfT7ud4HfQAXgYE9ve s80cqRCWt09cw8YeP0w3DjVTTyxUrGMeZjXPh3BOIgbJtfl3I156CulLlgSNx3P3TJx3coJFk+l abBYuMPIWvKCjVubD9yhyT5RNmn2JPQq3zW7nQxo X-Google-Smtp-Source: AGHT+IFKNj7hJWC4oJMBLwcHrbJKFzU741fyJjpiEA0lvIzSZBvtVDRvza7UfLchuqR7n2uWLN2Fyw== X-Received: by 2002:a05:6a20:144f:b0:1ee:c390:58a3 with SMTP id adf61e73a8af0-1f2f4cace5fmr10369405637.6.1740787335522; Fri, 28 Feb 2025 16:02:15 -0800 (PST) Received: from honey-badger.. ([38.34.87.7]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-aee7dedf5a8sm3993425a12.70.2025.02.28.16.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2025 16:02:15 -0800 (PST) From: Eduard Zingerman To: bpf@vger.kernel.org, ast@kernel.org Cc: andrii@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, kernel-team@fb.com, yonghong.song@linux.dev, Eduard Zingerman , Mykyta Yatsenko Subject: [PATCH bpf-next v2 3/3] veristat: report program type guess results to sdterr Date: Fri, 28 Feb 2025 16:01:47 -0800 Message-ID: <20250301000147.1583999-4-eddyz87@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250301000147.1583999-1-eddyz87@gmail.com> References: <20250301000147.1583999-1-eddyz87@gmail.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net In order not to pollute CSV output, e.g.: $ ./veristat -o csv exceptions_ext.bpf.o > test.csv Using guessed program type 'sched_cls' for exceptions_ext.bpf.o/extension... Using guessed program type 'sched_cls' for exceptions_ext.bpf.o/throwing_extension... Acked-by: Mykyta Yatsenko Signed-off-by: Eduard Zingerman --- tools/testing/selftests/bpf/veristat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c index 41dfcb6f5690..a18972ffdeb6 100644 --- a/tools/testing/selftests/bpf/veristat.c +++ b/tools/testing/selftests/bpf/veristat.c @@ -1234,13 +1234,13 @@ static void fixup_obj(struct bpf_object *obj, struct bpf_program *prog, const ch bpf_program__set_expected_attach_type(prog, attach_type); if (!env.quiet) { - printf("Using guessed program type '%s' for %s/%s...\n", + fprintf(stderr, "Using guessed program type '%s' for %s/%s...\n", libbpf_bpf_prog_type_str(prog_type), filename, prog_name); } } else { if (!env.quiet) { - printf("Failed to guess program type for freplace program with context type name '%s' for %s/%s. Consider using canonical type names to help veristat...\n", + fprintf(stderr, "Failed to guess program type for freplace program with context type name '%s' for %s/%s. Consider using canonical type names to help veristat...\n", ctx_name, filename, prog_name); } }