diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2016-11-23 17:44:47 -0800 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2016-11-28 16:46:42 -0800 |
commit | e6b929f1e88b6508dca4a92354b0db8bc8869e5d (patch) | |
tree | 2c4833a272c04c7a008bd15a2afe4ed1ca592bba /tools/aubdump.c | |
parent | 2758871e7d650dae8ef115ab1ae7005b7dd8f0c2 (diff) |
aubdump: Add a PCI-ID= entry to the AUB file comment
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'tools/aubdump.c')
-rw-r--r-- | tools/aubdump.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/aubdump.c b/tools/aubdump.c index b207aefd..6715a5d7 100644 --- a/tools/aubdump.c +++ b/tools/aubdump.c @@ -185,10 +185,16 @@ static void write_header(void) { char app_name[8 * 4]; + char comment[16]; + int comment_len, comment_dwords, dwords; uint32_t entry = 0x200003; + comment_len = snprintf(comment, sizeof(comment), "PCI-ID=0x%x", device); + comment_dwords = ((comment_len + 3) / 4); + /* Start with a (required) version packet. */ - dword_out(CMD_AUB_HEADER | (13 - 2)); + dwords = 13 + comment_dwords; + dword_out(CMD_AUB_HEADER | (dwords - 2)); dword_out((4 << AUB_HEADER_MAJOR_SHIFT) | (0 << AUB_HEADER_MINOR_SHIFT)); @@ -199,7 +205,8 @@ write_header(void) dword_out(0); /* timestamp */ dword_out(0); /* timestamp */ - dword_out(0); /* comment len */ + dword_out(comment_len); + data_out(comment, comment_dwords * 4); /* Set up the GTT. The max we can handle is 64M */ dword_out(CMD_AUB_TRACE_HEADER_BLOCK | ((gen >= 8 ? 6 : 5) - 2)); |