Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/sound/soc/intel/avs/trace.c
26583 views
1
// SPDX-License-Identifier: GPL-2.0-only
2
//
3
// Copyright(c) 2021-2022 Intel Corporation
4
//
5
// Author: Cezary Rojewski <[email protected]>
6
// Amadeusz Slawinski <[email protected]>
7
//
8
9
#include <linux/types.h>
10
11
#define CREATE_TRACE_POINTS
12
#include "trace.h"
13
14
#define BYTES_PER_LINE 16
15
#define MAX_CHUNK_SIZE ((PAGE_SIZE - 150) /* Place for trace header */ \
16
/ (2 * BYTES_PER_LINE + 4) /* chars per line */ \
17
* BYTES_PER_LINE)
18
19
void trace_avs_msg_payload(const void *data, size_t size)
20
{
21
size_t remaining = size;
22
size_t offset = 0;
23
24
while (remaining > 0) {
25
u32 chunk;
26
27
chunk = min_t(size_t, remaining, MAX_CHUNK_SIZE);
28
trace_avs_ipc_msg_payload(data, chunk, offset, size);
29
30
remaining -= chunk;
31
offset += chunk;
32
}
33
}
34
35