forked from SimonKagstrom/kcov
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue SimonKagstrom#92: system-mode: Implement system mode recording …
…via dyninst Instruments binaries using dyninst.
- Loading branch information
1 parent
ac63ebf
commit e43715b
Showing
16 changed files
with
1,525 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,11 @@ after_success: | |
|
||
the -s /path/to/outdir part can be skipped if kcov produces output in the current directory. | ||
|
||
Full-system instrumentation | ||
--------------------------- | ||
Using [dyninst](http://www.dyninst.org), Kcov can instrument all binaries with very low overhead for embedded systems. | ||
Refer to the [full system instrumentation](doc/full-system-instrumentation.md) documentation for details. | ||
|
||
More information | ||
---------------- | ||
kcov is written by Simon Kagstrom <[email protected]> and more | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# - Try to find dyninst | ||
# Once done this will define | ||
# | ||
# DYNINST_FOUND - system has dyninst | ||
# DYNINST_INCLUDE_DIRS - the dyninst include directory | ||
# DYNINST_LIBRARIES - Link these to use dyninst | ||
# DYNINST_DEFINITIONS - Compiler switches required for using dyninst | ||
# | ||
|
||
if (DYNINST_LIBRARIES AND DYNINST_INCLUDE_DIRS) | ||
set (Dyninst_FIND_QUIETLY TRUE) | ||
endif (DYNINST_LIBRARIES AND DYNINST_INCLUDE_DIRS) | ||
|
||
find_path (DYNINST_INCLUDE_DIR | ||
NAMES | ||
BPatch.h | ||
PATHS | ||
/usr/include/dyninst | ||
/usr/local/include/dyninst | ||
/opt/local/include/dyninst | ||
/sw/include/dyninst | ||
/sw/include/dyninst | ||
/usr/local/include | ||
ENV CPATH) # PATH and INCLUDE will also work | ||
if (DYNINST_INCLUDE_DIR) | ||
set (DYNINST_INCLUDE_DIRS ${DYNINST_INCLUDE_DIR}) | ||
endif (DYNINST_INCLUDE_DIR) | ||
|
||
find_library (DYNINST_LIBRARIES | ||
NAMES | ||
dyninstAPI | ||
PATHS | ||
/usr/lib | ||
/usr/lib64 | ||
/usr/local/lib | ||
/opt/local/lib | ||
/usr/local/lib64 | ||
/opt/local/lib64 | ||
/sw/lib | ||
/usr/lib/dyninst | ||
/usr/lib64/dyninst | ||
/usr/local/lib/dyninst | ||
/opt/local/lib/dyninst | ||
/usr/local/lib64/dyninst | ||
/opt/local/lib64/dyninst | ||
ENV LIBRARY_PATH # PATH and LIB will also work | ||
ENV LD_LIBRARY_PATH) | ||
|
||
include (FindPackageHandleStandardArgs) | ||
|
||
|
||
# handle the QUIETLY and REQUIRED arguments and set DYNINST_FOUND to TRUE | ||
# if all listed variables are TRUE | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DYNINST DEFAULT_MSG | ||
DYNINST_LIBRARIES | ||
DYNINST_INCLUDE_DIR) | ||
|
||
mark_as_advanced(DYNINST_INCLUDE_DIR DYNINST_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## *Full system instrumentation with kcov* | ||
Using [dyninst](http://www.dyninst.org), Kcov can instrument all binaries with very low overhead for embedded systems. | ||
|
||
Instrumenting binaries for a target system | ||
------------------------------------------ | ||
If your binaries (with debug symbols) are in e.g., sysroot, you can instrument binaries using | ||
|
||
``` | ||
kcov-system --system-record /tmp/out-sysroot sysroot | ||
``` | ||
|
||
After this finishes, build your filesystem (squashfs etc) using the instrumented binaries | ||
and install and run on your target. | ||
|
||
|
||
Creating a report from the collected data | ||
----------------------------------------- | ||
Copy `/tmp/kcov-data` from your target system and run | ||
|
||
``` | ||
kcov-system --system-report /tmp/kcov /tmp/kcov-data | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.