summaryrefslogtreecommitdiff
path: root/tools/aubdump.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-11-23 17:44:08 -0800
committerJason Ekstrand <jason.ekstrand@intel.com>2016-11-28 16:46:40 -0800
commit2758871e7d650dae8ef115ab1ae7005b7dd8f0c2 (patch)
treea55efd7151bae62ee6c1044157b281be0653b2e4 /tools/aubdump.c
parent16cd4118877d4df7c2e6fe4879de8021e95b1877 (diff)
aubdump: Set the application name
This will help with identifying aub files Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'tools/aubdump.c')
-rw-r--r--tools/aubdump.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/aubdump.c b/tools/aubdump.c
index b1c46e2b..b207aefd 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -184,14 +184,18 @@ gtt_size(void)
static void
write_header(void)
{
+ char app_name[8 * 4];
uint32_t entry = 0x200003;
/* Start with a (required) version packet. */
dword_out(CMD_AUB_HEADER | (13 - 2));
dword_out((4 << AUB_HEADER_MAJOR_SHIFT) |
(0 << AUB_HEADER_MINOR_SHIFT));
- for (int i = 0; i < 8; i++)
- dword_out(0); /* app name */
+
+ /* Next comes a 32-byte application name. */
+ strncpy(app_name, program_invocation_short_name, sizeof(app_name));
+ app_name[sizeof(app_name) - 1] = 0;
+ data_out(app_name, sizeof(app_name));
dword_out(0); /* timestamp */
dword_out(0); /* timestamp */