From: Hao Luo <haoluo@google.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
daniel@iogearbox.net, dwarves@vger.kernel.org, yhs@fb.com,
Hao Luo <haoluo@google.com>
Subject: [PATCH 2/2] btf_encoder: Introduce option '--btf_encode_force'
Date: Fri, 18 Sep 2020 13:40:58 -0700 [thread overview]
Message-ID: <20200918204058.1030519-3-haoluo@google.com> (raw)
In-Reply-To: <20200918204058.1030519-1-haoluo@google.com>
Commit f3d9054ba8ff ("btf_encoder: Teach pahole to store percpu
variables in vmlinux BTF.") introduced an option '-j' that makes best
effort in emitting VAR entries in BTF. Before no one has been using
this flag, replace the one-letter option '-j' with a full flag name
'--btf_encode_force' to save '-j' for future uses.
Signed-off-by: Hao Luo <haoluo@google.com>
---
pahole.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/pahole.c b/pahole.c
index 079d951..3297729 100644
--- a/pahole.c
+++ b/pahole.c
@@ -27,6 +27,7 @@ static bool btf_encode;
static bool ctf_encode;
static bool first_obj_only;
static bool btf_encode_symbols;
+static bool btf_encode_force;
static uint8_t class__include_anonymous;
static uint8_t class__include_nested_anonymous;
@@ -62,7 +63,6 @@ static int show_reorg_steps;
static const char *class_name;
static LIST_HEAD(class_names);
static char separator = '\t';
-static bool force;
static struct conf_fprintf conf = {
.emit_stats = 1,
@@ -811,6 +811,7 @@ ARGP_PROGRAM_VERSION_HOOK_DEF = dwarves_print_version;
#define ARGP_size_bytes 315
#define ARGP_range 316
#define ARGP_btf_encode_symbols 317
+#define ARGP_btf_encode_force 318
static const struct argp_option pahole__options[] = {
{
@@ -1095,8 +1096,8 @@ static const struct argp_option pahole__options[] = {
.doc = "Encode global symbols in BTF. Off by default."
},
{
- .name = "force",
- .key = 'j',
+ .name = "btf_encode_force",
+ .key = ARGP_btf_encode_force,
.doc = "Ignore those symbols found invalid when encoding BTF."
},
{
@@ -1143,7 +1144,6 @@ static error_t pahole__options_parser(int key, char *arg,
case 'J': btf_encode = 1;
conf_load.get_addr_info = true;
no_bitfield_type_recode = true; break;
- case 'j': force = true; break;
case 'l': conf.show_first_biggest_size_base_type_member = 1; break;
case 'M': conf.show_only_data_members = 1; break;
case 'm': stats_formatter = nr_methods_formatter; break;
@@ -1216,6 +1216,8 @@ static error_t pahole__options_parser(int key, char *arg,
conf.header_type = arg; break;
case ARGP_btf_encode_symbols:
btf_encode_symbols = true; break;
+ case ARGP_btf_encode_force:
+ btf_encode_force = true; break;
default:
return ARGP_ERR_UNKNOWN;
}
@@ -2361,7 +2363,8 @@ static enum load_steal_kind pahole_stealer(struct cu *cu,
goto filter_it;
if (btf_encode) {
- cu__encode_btf(cu, global_verbose, force, btf_encode_symbols);
+ cu__encode_btf(cu, global_verbose, btf_encode_force,
+ btf_encode_symbols);
return LSK__KEEPIT;
}
--
2.28.0.681.g6f77f65b4e-goog
next prev parent reply other threads:[~2020-09-18 20:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-18 20:40 [PATCH 0/2] pahole: Make encoding percpu vars into BTF optional Hao Luo
2020-09-18 20:40 ` [PATCH 1/2] btf_encoder: Make encoding " Hao Luo
2020-09-18 21:24 ` Arnaldo Carvalho de Melo
2020-09-18 21:26 ` Hao Luo
2020-09-18 21:40 ` Arnaldo Carvalho de Melo
2020-09-18 20:40 ` Hao Luo [this message]
2020-09-19 0:57 ` [PATCH 0/2] pahole: Make encoding percpu " Alexei Starovoitov
2020-09-19 4:00 ` Hao Luo
2020-09-21 12:27 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200918204058.1030519-3-haoluo@google.com \
--to=haoluo@google.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=arnaldo.melo@gmail.com \
--cc=daniel@iogearbox.net \
--cc=dwarves@vger.kernel.org \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).