Skip to content

Commit 8a2798d

Browse files
committed
update doc and ci make.sh script
1 parent c303a73 commit 8a2798d

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Stackusage
55
|-----------|---------|
66
| [![Linux](https://github.com/d99kris/stackusage/workflows/Linux/badge.svg)](https://github.com/d99kris/stackusage/actions?query=workflow%3ALinux) | [![macOS](https://github.com/d99kris/stackusage/workflows/macOS/badge.svg)](https://github.com/d99kris/stackusage/actions?query=workflow%3AmacOS) |
77

8-
Stackusage measures stack usage in Linux and macOS applications (main thread and
9-
native pthread child threads). The measured stack utilization data can be used to
10-
adjust the stack size allocation to provide desired margin for child threads. This
11-
is primarily useful for applications and libraries designed to work in
12-
resource-constrained environments (such as embedded systems).
8+
Stackusage measures stack usage in Linux and macOS applications (main thread
9+
and native pthread child threads). The measured stack utilization data can be
10+
used to adjust the stack size allocation to provide desired margin for child
11+
threads. This is primarily useful for applications and libraries designed to
12+
work in resource-constrained environments (such as embedded systems).
1313

1414
Example Usage
1515
=============
@@ -28,13 +28,15 @@ Example Usage
2828
Supported Platforms
2929
===================
3030
Stackusage is primarily developed and tested on Linux, but basic
31-
functionality should work in macOS / OS X as well. Current version has been tested on:
32-
- OS X El Capitan 10.11
33-
- Ubuntu 16.04 LTS
31+
functionality should work in macOS / OS X as well. Current version has been
32+
tested on:
33+
- macOS Big Sur 11.0
34+
- Ubuntu 20.04 LTS
3435

35-
Limitation: On macOS / OS X this tool relies on code injection using DYLD_INSERT_LIBRARIES,
36-
which generally does not work with third-party applications in a standard system. Using it on
37-
(your own) applications built from source should work fine though.
36+
Limitation: On macOS / OS X this tool relies on code injection using
37+
DYLD_INSERT_LIBRARIES, which generally does not work with third-party
38+
applications in a standard system. Using it on (your own) applications built
39+
from source should work fine though.
3840

3941
Installation
4042
============
@@ -71,7 +73,8 @@ Options:
7173
--help display this help and exit
7274
--version output version information and exit
7375

74-
Example checking stack usage of test program 'ex001' with stackusage installed on system:
76+
Example checking stack usage of test program 'ex001' with stackusage installed
77+
on system:
7578

7679
stackusage ./ex001
7780

@@ -106,7 +109,8 @@ Description of columns:
106109
dur thread duration in seconds
107110
funcP (nil) for main, pointer to start_routine for child threads
108111

109-
The function that funcP points to can be determined for example using addr2line:
112+
The function that funcP points to can be determined for example using
113+
addr2line:
110114

111115
$ addr2line -f -e ./ex001 0x4009b0
112116
thread_start

make.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ fi
8383

8484
# build
8585
if [[ "${BUILD}" == "1" ]]; then
86+
OS="$(uname)"
8687
MAKEARGS=""
8788
if [ "${OS}" == "Linux" ]; then
8889
MAKEARGS="-j$(nproc)"
@@ -100,7 +101,12 @@ fi
100101
# doc
101102
if [[ "${DOC}" == "1" ]]; then
102103
if [[ -x "$(command -v help2man)" ]]; then
103-
cd src && help2man -n "measure stack usage in applications" -N -o stackusage.1 ./stackusage && cd .. || exiterr "doc failed, exiting."
104+
if [[ "$(uname)" == "Darwin" ]]; then
105+
SED="gsed -i"
106+
else
107+
SED="sed -i"
108+
fi
109+
cd src && help2man -n "measure stack usage in applications" -N -o stackusage.1 ./stackusage && cd .. && ${SED} "s/\.\\\\\" DO NOT MODIFY THIS FILE\! It was generated by help2man.*/\.\\\\\" DO NOT MODIFY THIS FILE\! It was generated by help2man./g" src/stackusage.1 || exiterr "doc failed, exiting."
104110
fi
105111
fi
106112

src/stackusage.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.16.
1+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
22
.TH STACKUSAGE "1" "December 2020" "stackusage v1.12" "User Commands"
33
.SH NAME
44
stackusage \- measure stack usage in applications

0 commit comments

Comments
 (0)