bcc: Use bpf_probe_read_str to read tracepoint data_loc field
The data_loc field (defined as __string in kernel source) should
be treated as string NOT a fixed-size array, add a new macro
TP_DATA_LOC_READ_STR which use bpf_probe_read_str to reflect this.
@@ -1356,5 +1356,11 @@ static int ____##name(unsigned long long *ctx, ##args)
bpf_probe_read((void *)dst, __length, (char *)args + __offset); \
} while (0);
+#define TP_DATA_LOC_READ_STR(dst, field, length) \
+ do { \
+ unsigned short __offset = args->data_loc_##field & 0xFFFF; \
+ bpf_probe_read_str((void *)dst, length, (char *)args + __offset); \
+ } while (0);
+
#endif
)********"
