From 27d4c943f36025f98c6a906baef93372cb53d728 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 3 Jun 2020 16:08:27 +0200 Subject: [PATCH] testbench: Add UUID for file component Each component driver should have assigned UUID value and trace contecxt, to allow generic component creation routine usage. It's espiecially important for trace context, because it's accessed by pointer so dereferencing NULL pointer will lead to segmentation fault. Signed-off-by: Karol Trzcinski --- tools/testbench/file.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/testbench/file.c b/tools/testbench/file.c index 31db99168..9a5b20368 100644 --- a/tools/testbench/file.c +++ b/tools/testbench/file.c @@ -21,6 +21,11 @@ #include "testbench/common_test.h" #include "testbench/file.h" +/* bfc7488c-75aa-4ce8-9bde-d8da08a698c2 */ +DECLARE_SOF_UUID("file", file_uuid, 0xbfc7488c, 0x75aa, 0x4ce8, + 0x9d, 0xbe, 0xd8, 0xda, 0x08, 0xa6, 0x98, 0xc2); +DECLARE_TR_CTX(file_tr, SOF_UUID(file_uuid), LOG_LEVEL_INFO); + static const struct comp_driver comp_file_dai; static const struct comp_driver comp_file_host; @@ -759,6 +764,8 @@ static int file_get_hw_params(struct comp_dev *dev, static const struct comp_driver comp_file_host = { .type = SOF_COMP_HOST, + .uid = SOF_UUID(file_tr), + .tctx = &file_tr, .ops = { .create = file_new, .free = file_free, @@ -769,10 +776,13 @@ static const struct comp_driver comp_file_host = { .prepare = file_prepare, .reset = file_reset, }, + }; static const struct comp_driver comp_file_dai = { .type = SOF_COMP_DAI, + .uid = SOF_UUID(file_tr), + .tctx = &file_tr, .ops = { .create = file_new, .free = file_free,