aboutsummaryrefslogtreecommitdiff
path: root/core/trace.c
AgeCommit message (Collapse)AuthorFilesLines
2019-07-26SPDX-ify all skiboot codeStewart Smith1-13/+4
Use Software Package Data Exchange (SPDX) to indicate license for each file that is unique to skiboot. At the same time, ensure the (C) who and years are correct. See https://spdx.org/ Signed-off-by: Stewart Smith <stewart@linux.ibm.com> [oliver: Added a few missing files] Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-05-20core/trace: Export trace buffers to sysfsJordan Niethe1-0/+10
Every property in the device-tree under /ibm,opal/firmware/exports has a sysfs node created in /firmware/opal/exports. Add properties with the physical address and size for each trace buffer so they are exported. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-05-20core/trace: Add pir number to debug_descriptorJordan Niethe1-3/+4
The names given to the trace buffers when exported to sysfs should show what cpu they are associated with to make it easier to understand there output. The debug_descriptor currently stores the address and length of each trace buffer and this is used for adding properties to the device tree. Extend debug_descriptor to include a cpu associated with each trace. This will be used for creating properties in the device-tree under /ibm,opal/firmware/exports/. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-05-20core/trace: Change buffer alignment from 4K to 64KJordan Niethe1-5/+5
We want to be able to mmap the trace buffers to be used by the dump_trace tool. This means that the trace bufferes must be page aligned. Currently they are aligned to 4K. Most power systems have a 64K page size. On systems with a 4K page size, 64K aligned will still be page aligned. Change the allocation of the trace buffers to be 64K aligned. The trace_info struct that contains the trace buffer is actually what is allocated aligned memory. This means the trace buffer itself is not actually aligned and this is the address that is currently exposed through sysfs. To get around this change the address that is exposed to sysfs to be the trace_info struct. This means the lock in trace_info is now visible too. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-05-20core/trace: Change mask/and to modulo for buffer offsetJordan Niethe1-9/+9
We would like the be able to mmap the trace buffers so that the dump_trace tool is able to make use of the existing functions for reading traces in external/trace. Mmaping is done by pages which means that buffers should be aligned to page size. This is not as simple as setting the buffer length to a page aligned value as the buffers each have a header and leave space for an extra entry at the end. These must be taken into account so the entire buffer will be page aligned. The current method of calculating buffer offsets is to use a mask and bitwise 'and'. This limits the potential sizes of the buffer to powers of two. The initial justification for using the mask was that the buffers had different sizes so the offset needed to based on information the buffers carried with them, otherwise they could overflow. Being limited to powers of two will make it impossible to page align the entire buffer. Change to using modulo for calculating the buffer offset to make a much larger range of buffer sizes possible. Instead of the mask, make each buffer carry around the length of the buffer to be used for calculating the offset to avoid overflows. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-05-20core/trace: Put boot_tracebuf in correct location.Jordan Niethe1-1/+1
A position for the boot_tracebuf is allocated in skiboot.lds.S. However, without a __section attribute the boot trace buffer is not placed in the correct location, meaning that it also will not be correctly aligned. Add the __section attribute to ensure it will be placed in its allocated position. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-18Split debug_descriptor out into own include fileStewart Smith1-0/+1
We only touch it in limited places, let's simplify skiboot.h Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-04-18core/test/run-trace: fix on ppc64elStewart Smith1-1/+2
Hackish fix from benh Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2016-12-21tree-wide: use dt_add_property_u64s() where we canOliver O'Halloran1-2/+1
A few places (mostly old code) were using: add_property_cells(hi32(number), lo32(number)); This patch converts them to use the helper rather than doing it manually. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-09Fix sparse warning in trace repeat structureStewart Smith1-1/+1
core/trace.c:106:23: warning: incorrect type in assignment (different base types) core/trace.c:106:23: expected restricted beint16_t [usertype] prev_len core/trace.c:106:23: got int Never read anywhere (by anyone), but silences a warning by doing the right thing. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-09Fix sparse warnings in init_boot_tracebuf()Stewart Smith1-2/+2
core/trace.c:43:42: warning: incorrect type in assignment (different base types) core/trace.c:43:42: expected restricted beint64_t static [toplevel] [usertype] mask core/trace.c:43:42: got int core/trace.c:44:46: warning: incorrect type in assignment (different base types) core/trace.c:44:46: expected restricted beint32_t static [toplevel] [usertype] max_size core/trace.c:44:46: got unsigned long Shouldn't affect any runtime code, just cleans up the warnings. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-06-11Move boot_tracebuf to BSSStewart Smith1-10/+5
this saves 65720 bytes from skiboot.lid Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-06Move skiboot internal things from opal.h to opal-api.hStewart Smith1-0/+1
This is probably not the best collection of things in the world, but it means that opal.h is much closer to being directly usable by an OS. This triggers a bunch of #include fixes throughout the tree. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-28More trace endian fixes so make check works againBenjamin Herrenschmidt1-19/+24
We need the core to do proper endian among others since that code is compiled in run-trace Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-02Initial commit of Open Source releaseBenjamin Herrenschmidt1-0/+244
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>