aboutsummaryrefslogtreecommitdiff
path: root/tools/lib/traceevent/parse-filter.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-06-01 11:40:46 +0100
committerMark Brown <broonie@kernel.org>2018-06-01 11:40:46 +0100
commit1e82572e5f806782cc1bf06e6d22905c28b0a9f5 (patch)
treec428a640fca2ee5c6bfe259482b941f5e0ece927 /tools/lib/traceevent/parse-filter.c
parent29e8549d35499289ce6211a553f956a2ab9a3905 (diff)
parent86a04ba0955e3c806ed301cf178f1e130f1cb785 (diff)
Merge branch 'linux-linaro-lsk-v4.9' into linux-linaro-lsk-v4.9-rtlsk-v4.9-18.05-rt
Diffstat (limited to 'tools/lib/traceevent/parse-filter.c')
-rw-r--r--tools/lib/traceevent/parse-filter.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index 7c214ceb9386..5e10ba796a6f 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -1879,17 +1879,25 @@ static const char *get_field_str(struct filter_arg *arg, struct pevent_record *r
struct pevent *pevent;
unsigned long long addr;
const char *val = NULL;
+ unsigned int size;
char hex[64];
/* If the field is not a string convert it */
if (arg->str.field->flags & FIELD_IS_STRING) {
val = record->data + arg->str.field->offset;
+ size = arg->str.field->size;
+
+ if (arg->str.field->flags & FIELD_IS_DYNAMIC) {
+ addr = *(unsigned int *)val;
+ val = record->data + (addr & 0xffff);
+ size = addr >> 16;
+ }
/*
* We need to copy the data since we can't be sure the field
* is null terminated.
*/
- if (*(val + arg->str.field->size - 1)) {
+ if (*(val + size - 1)) {
/* copy it */
memcpy(arg->str.buffer, val, arg->str.field->size);
/* the buffer is already NULL terminated */