ctf_encoder: Allow specifying a verbose level for cu__encode_ctf

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2009-12-06 14:17:29 -02:00
parent 25cd635806
commit 01a7fb50d4
3 changed files with 13 additions and 11 deletions

View File

@ -247,7 +247,7 @@ static struct variable *hashaddr__find_variable(const struct hlist_head hashtabl
*/ */
extern struct strings *strings; extern struct strings *strings;
int cu__encode_ctf(struct cu *self) int cu__encode_ctf(struct cu *self, int verbose)
{ {
int err = -1; int err = -1;
struct ctf *ctf = ctf__new(self->filename, self->elf); struct ctf *ctf = ctf__new(self->filename, self->elf);
@ -288,10 +288,11 @@ int cu__encode_ctf(struct cu *self)
int64_t position; int64_t position;
function = hashaddr__find_function(hash_addr, addr); function = hashaddr__find_function(hash_addr, addr);
if (function == NULL) { if (function == NULL) {
fprintf(stderr, if (verbose)
"function %4d: %-20s %#llx %5u NOT FOUND!\n", fprintf(stderr,
id, sym_name, "function %4d: %-20s %#Lx %5u NOT FOUND!\n",
(unsigned long long)addr, elf_sym__size(&sym)); id, sym_name, addr,
elf_sym__size(&sym));
err = ctf__add_function(ctf, 0, 0, 0, &position); err = ctf__add_function(ctf, 0, 0, 0, &position);
if (err != 0) if (err != 0)
goto out_err_ctf; goto out_err_ctf;
@ -330,10 +331,11 @@ int cu__encode_ctf(struct cu *self)
var = hashaddr__find_variable(hash_addr, addr); var = hashaddr__find_variable(hash_addr, addr);
if (var == NULL) { if (var == NULL) {
fprintf(stderr, if (verbose)
"variable %4d: %-20s %#llx %5u NOT FOUND!\n", fprintf(stderr,
id, sym_name, (unsigned long long)addr, "variable %4d: %-20s %#Lx %5u NOT FOUND!\n",
elf_sym__size(&sym)); id, sym_name, addr,
elf_sym__size(&sym));
err = ctf__add_object(ctf, 0); err = ctf__add_object(ctf, 0);
if (err != 0) if (err != 0)
goto out_err_ctf; goto out_err_ctf;

View File

@ -11,6 +11,6 @@
struct cu; struct cu;
int cu__encode_ctf(struct cu *self); int cu__encode_ctf(struct cu *self, int verbose);
#endif /* _CTF_ENCODER_H_ */ #endif /* _CTF_ENCODER_H_ */

View File

@ -1106,7 +1106,7 @@ static enum load_steal_kind pahole_stealer(struct cu *cu,
goto filter_it; goto filter_it;
if (ctf_encode) { if (ctf_encode) {
cu__encode_ctf(cu); cu__encode_ctf(cu, global_verbose);
/* /*
* We still have to get the type signature code merged to eliminate * We still have to get the type signature code merged to eliminate
* dups, reference another CTF file, etc, so for now just encode the * dups, reference another CTF file, etc, so for now just encode the