summaryrefslogtreecommitdiff
path: root/tools/proftool.c
AgeCommit message (Collapse)AuthorFilesLines
2023-09-23trace: Fix alignment logic in flyrecord headerMichal Simek1-2/+29
Current alignment which is using 16 bytes is not correct in connection to trace_clocks description and it's length. That's why use start_addr variable and record proper size based on used entries. Fixes: be16fc81b2ed ("trace: Update proftool to use new binary format"). Signed-off-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-09-23trace: Move trace_clocks description above record offset calculationMichal Simek1-3/+4
Flyrecord tracing data are page aligned that's why it is necessary to calculate alignment properly. Because trace_clocks description is the part of record length it is necessary to have information about length earlier. Signed-off-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-09-23trace: Use 64bit variable for start and lenMichal Simek1-1/+2
tputq() requires variables to have 64bit width that's why make them 64bit to clean alignment requirement. Signed-off-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-22proftool: Remove unused variables in make_flame_treeTom Rini1-14/+1
With clang-15 we now get reported that in the make_flame_tree function, neither the missing_count nor depth variables are used, only incremenete/decremented. Remove these. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Provide a flamegraph that uses timingSimon Glass1-11/+97
Add a second variant of the flame graph that shows records in terms of the number of microseconds used by each call stack. This is a useful way of seeing where time is going within the execution of U-Boot. This requires a call stack that records the start time of each function, as well as a way of subtracting all time consumed by child functions, so that this time is not counted twice by the flamegraph. The time values in the output are just for the function itself, not for its children. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Support output of a flamegraphSimon Glass1-1/+271
It is useful to see how many times each function is called, particularly in the context of its callers. A flamegraph is a way of showing this. Support output in this format which can be used by the flamegraph.pl script, to generate an SVG image for browsing. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Support output of funcgraph recordsSimon Glass1-32/+150
Add support for writing ftrace records in the 'funcgraph' format, which shows function entry and exit points as well as the time taken by each function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Use text_base from the trace headerSimon Glass1-1/+6
Use the information in the trace header instead of reading it from the trace records. Add debugging to check that System.map and the trace header agree on this value. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Drop use of objsectionSimon Glass1-28/+1
This feature was only partly implemented and serves no current purpose. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Update proftool to use new binary formatSimon Glass1-45/+851
The old text format is not much used anymore. Instead a new trace-cmd tool has introduced a binary format for trace records. Add support for generating this format. This involves removing the old text format, adding various helpers for the new format and adjusting the code to use an output file instead of stdout. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Rename prof to trace and improve commentsSimon Glass1-39/+157
The current use of 'profile' in some places is confusing. Update the code to use the word 'trace' consistently. Change the flags to better match their meaning and add some more comments. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18trace: Update trace-format generator for newer versionSimon Glass1-6/+13
This now includes flags and the layout has changed slightly in recent versions of Linux. Update the generator accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18trace: Adjust flags in proftoolSimon Glass1-12/+12
The flags in this tool don't match the comments or help. Also the variable names are quite confusing. Update them for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19command: Remove the cmd_tbl_t typedefSimon Glass1-1/+1
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-11trace: do not limit trace buffer to 2GiBHeinrich Schuchardt1-2/+2
There is no good reason to limit the trace buffer to 2GiB on a 64bit system. Adjust the types of the relevant parameters. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2015-11-17tools/proftool: fix use-after-freeVincent Stehlé1-2/+3
The read_trace_config() can dereference the line pointer after freeing it on its error path. Avoid that. This was found by Coverity Scan. Signed-off-by: Vincent Stehlé <vincent.stehle@freescale.com> Cc: Simon Glass <sjg@chromium.org>
2015-05-09Fix musl buildJörg Krause1-0/+1
This patch fixes cross-compiling U-Boot tools with the musl C library: * including <sys/types.h> is needed for ulong * defining _GNU_SOURCE is needed for loff_t Tested for target at91sam9261ek_dataflash_cs3. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks> Cc: Tom Rini <trini@konsulko.com>
2013-07-24Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk1-14/+1
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
2013-07-03tools/proftool: remove REG_NOERRORAndreas Bießmann1-1/+1
Remove non portable usage of REG_NOERROR. BSD (like OS X) variants of regex.h do not declare REG_NOERROR, even GNU regex(3) does not mention REG_NOERROR, just remove it. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Acked-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2013-06-26Add proftool to decode profile dataSimon Glass1-0/+611
This tool provides the facility to decode U-Boot trace data and write out a text file in Linux ftrace format for use with pytimechart. Signed-off-by: Simon Glass <sjg@chromium.org>