Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/arch/xtensa/include/arch/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct timer {
uint32_t hitime; /* high end of 64bit timer */
uint32_t hitimeout;
uint32_t lowtimeout;
uint64_t delta;
};

/* internal API calls */
Expand Down
2 changes: 1 addition & 1 deletion src/include/uapi/abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

/** \brief SOF ABI version major, minor and patch numbers */
#define SOF_ABI_MAJOR 3
#define SOF_ABI_MINOR 6
#define SOF_ABI_MINOR 7
#define SOF_ABI_PATCH 0

/** \brief SOF ABI version number. Format within 32bit word is MMmmmppp */
Expand Down
1 change: 1 addition & 0 deletions src/include/uapi/ipc/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@

#define SOF_IPC_TRACE_DMA_PARAMS SOF_CMD_TYPE(0x001)
#define SOF_IPC_TRACE_DMA_POSITION SOF_CMD_TYPE(0x002)
#define SOF_IPC_TRACE_DMA_PARAMS_EXT SOF_CMD_TYPE(0x003)

/** @} */

Expand Down
10 changes: 10 additions & 0 deletions src/include/uapi/ipc/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,22 @@
#define SOF_TRACE_FILENAME_SIZE 32

/* DMA for Trace params info - SOF_IPC_DEBUG_DMA_PARAMS */
/* Deprecated - use sof_ipc_dma_trace_params_ext */
struct sof_ipc_dma_trace_params {
struct sof_ipc_cmd_hdr hdr;
struct sof_ipc_host_buffer buffer;
uint32_t stream_tag;
} __attribute__((packed));

/* DMA for Trace params info - SOF_IPC_DEBUG_DMA_PARAMS_EXT */
struct sof_ipc_dma_trace_params_ext {
struct sof_ipc_cmd_hdr hdr;
struct sof_ipc_host_buffer buffer;
uint32_t stream_tag;
uint64_t timestamp;
Comment thread
plbossart marked this conversation as resolved.
Outdated
uint32_t reserved[8];
} __attribute__((packed));

/* DMA for Trace params info - SOF_IPC_DEBUG_DMA_PARAMS */
struct sof_ipc_dma_trace_posn {
struct sof_ipc_reply rhdr;
Expand Down
9 changes: 8 additions & 1 deletion src/ipc/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,12 +719,18 @@ static int ipc_dma_trace_config(uint32_t header)
struct dma_sg_elem_array elem_array;
uint32_t ring_size;
#endif
struct sof_ipc_dma_trace_params params;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm that the deprecated method will still work ? (albeit with no timestamp)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgirdwood Yes, I tried with older kernel and it works.

struct sof_ipc_dma_trace_params_ext params;
int err;

/* copy message with ABI safe method */
IPC_COPY_CMD(params, _ipc->comp_data);

if (iCS(header) == SOF_IPC_TRACE_DMA_PARAMS_EXT)
platform_timer->delta = params.timestamp -
platform_timer_get(platform_timer);
else
platform_timer->delta = 0;

#ifdef CONFIG_SUECREEK
return 0;
#endif
Expand Down Expand Up @@ -806,6 +812,7 @@ static int ipc_glb_debug_message(uint32_t header)

switch (cmd) {
case SOF_IPC_TRACE_DMA_PARAMS:
case SOF_IPC_TRACE_DMA_PARAMS_EXT:
return ipc_dma_trace_config(header);
default:
trace_ipc_error("ipc: unknown debug cmd 0x%x", cmd);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static void put_header(uint32_t *dst, uint32_t id_0, uint32_t id_1,
header.id_0 = id_0 & TRACE_ID_MASK;
header.id_1 = id_1 & TRACE_ID_MASK;
header.core_id = cpu_get_id();
header.timestamp = timestamp;
header.timestamp = timestamp + platform_timer->delta;
header.log_entry_address = entry;

memcpy(dst, &header, sizeof(header));
Expand Down