Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

Linux/AM3351: PRU trace buffer usage

$
0
0

Part Number:AM3351

Tool/software: Linux

Hi,

I created a simple PRU project in CCS. I want to test out the tracing functionality of the remoteproc driver.

My resource table looks like this:

struct my_resource_table {
	struct resource_table base;

	uint32_t offset[1]; /* Should match 'num' in actual definition */

	/* intc definition */
	//struct fw_rsc_custom pru_ints;
	struct fw_rsc_trace trace;
};

#pragma DATA_SECTION(pru_remoteproc_ResourceTable, ".resource_table")
#pragma RETAIN(pru_remoteproc_ResourceTable)
struct my_resource_table pru_remoteproc_ResourceTable = {
	1,	/* we're the first version that implements this */
	1,	/* number of entries in the table */
	0, 0,	/* reserved, must be zero */
	{
	 offsetof(struct my_resource_table, trace)	/* offset[0] */
	},
	{
	 TYPE_TRACE,
	 0,
	 256,
	 0,
	 "test_trace"
	}
};

I successfully get a trace0 file in /sys/kernel/debug/remoteproc/remoteproc1 directory. Right now I directly write to the memory address pointed by the da field in struct fw_rsc_trace trace. When I use the cat command on the trace0 file, I got what I wrote into the buffer in the pru firmware.

My question is, what is the proper usage of the trace buffer? On the linux side, can I continuously read this file line by line? Are there any helper functions on the PRU side?

Thank you!


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>