Skip to content

Commit e6c5e46

Browse files
committed
initial commit
This is a standalone version of systemd-bootchart, extracted from the systemd repository as of commit ID 2c45295e4764. The idea is to give this tool a new home, because it is not actually related to systemd in any way, can well live outside of the repository, and is actually useful beyond the scope of systemd itself.
0 parents  commit e6c5e46

114 files changed

Lines changed: 19176 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
*.a
2+
*.cache
3+
*.html
4+
*.la
5+
*.lo
6+
*.log
7+
*.o
8+
*.plist
9+
*.pyc
10+
*.stamp
11+
*.swp
12+
*.trs
13+
*~
14+
.config.args
15+
.deps/
16+
.dirstamp
17+
.libs/
18+
/*.gcda
19+
/*.gcno
20+
/*.tar.bz2
21+
/*.tar.gz
22+
/*.tar.xz
23+
/build-aux
24+
/libtool
25+
/Makefile
26+
/TAGS
27+
/GPATH
28+
/GRTAGS
29+
/GSYMS
30+
/GTAGS
31+
/systemd-bootchart
32+
Makefile.in
33+
aclocal.m4
34+
config.h
35+
config.h.in
36+
config.log
37+
config.status
38+
configure
39+
stamp-*

Makefile.am

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
# -*- Mode: makefile; indent-tabs-mode: t -*-
2+
#
3+
# This file is part of systemd-bootchart
4+
#
5+
# systemd is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU Lesser General Public License as published by
7+
# the Free Software Foundation; either version 2.1 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# systemd is distributed in the hope that it will be useful, but
11+
# WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
# Lesser General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU Lesser General Public License
16+
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
17+
18+
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
19+
AM_MAKEFLAGS = --no-print-directory
20+
AUTOMAKE_OPTIONS = color-tests parallel-tests
21+
22+
GCC_COLORS ?= 'ooh, shiny!'
23+
export GCC_COLORS
24+
25+
SUBDIRS = .
26+
27+
# remove targets if the command fails
28+
.DELETE_ON_ERROR:
29+
30+
# keep intermediate files
31+
.SECONDARY:
32+
33+
# Keep the test-suite.log
34+
.PRECIOUS: $(TEST_SUITE_LOG) Makefile
35+
36+
# Dirs of external packages
37+
systemdir=@systemdir@
38+
39+
# And these are the special ones for /
40+
rootprefix=@rootprefix@
41+
rootbindir=$(rootprefix)/bin
42+
rootlibexecdir=$(rootprefix)/lib/systemd
43+
pkgsysconfdir=$(sysconfdir)/systemd
44+
systemunitdir=$(rootprefix)/lib/systemd/system
45+
46+
AM_CFLAGS = $(OUR_CFLAGS)
47+
AM_LDFLAGS = $(OUR_LDFLAGS)
48+
AM_CPPFLAGS = \
49+
-include $(top_builddir)/config.h \
50+
-DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
51+
-DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
52+
-DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
53+
-DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
54+
-DROOTPREFIX=\"$(rootprefix)\" \
55+
-DLIBDIR=\"$(libdir)\" \
56+
-DROOTLIBDIR=\"$(rootlibdir)\" \
57+
-DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
58+
-I $(top_srcdir)/src
59+
60+
#####################################################
61+
62+
EXTRA_DIST = man/bootchart.conf.xml man/systemd-bootchart.xml units/systemd-bootchart.service.in
63+
MANPAGES = man/bootchart.conf.5 man/systemd-bootchart.1
64+
MANPAGES_ALIAS = man/bootchart.conf.d.5
65+
66+
man_MANS = $(MANPAGES) $(MANPAGES_ALIAS)
67+
68+
man/bootchart.conf.d.5: man/bootchart.conf.5
69+
70+
XSLTPROC_FLAGS = \
71+
--nonet \
72+
--xinclude \
73+
--stringparam man.output.quietly 1 \
74+
--stringparam funcsynopsis.style ansi \
75+
--stringparam man.authors.section.enabled 0 \
76+
--stringparam man.copyright.section.enabled 0 \
77+
--stringparam systemd.version $(VERSION) \
78+
--path '$(builddir)/man:$(srcdir)/man'
79+
80+
XSLT = $(if $(XSLTPROC), $(XSLTPROC), xsltproc)
81+
XSLTPROC_PROCESS_MAN = \
82+
$(AM_V_XSLT)$(XSLT) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
83+
84+
man/%.1: man/%.xml man/custom-man.xsl
85+
$(XSLTPROC_PROCESS_MAN)
86+
87+
man/%.5: man/%.xml man/custom-man.xsl
88+
$(XSLTPROC_PROCESS_MAN)
89+
90+
#####################################################
91+
92+
libutils_la_SOURCES = \
93+
src/alloc-util.c \
94+
src/alloc-util.h \
95+
src/architecture.h \
96+
src/build.h \
97+
src/cgroup-util.c \
98+
src/cgroup-util.h \
99+
src/conf-files.c \
100+
src/conf-files.h \
101+
src/conf-parser.c \
102+
src/conf-parser.h \
103+
src/def.h \
104+
src/dirent-util.c \
105+
src/dirent-util.h \
106+
src/escape.c \
107+
src/escape.h \
108+
src/fd-util.c \
109+
src/fd-util.h \
110+
src/fileio.c \
111+
src/fileio.h \
112+
src/formats-util.h \
113+
src/fs-util.c \
114+
src/fs-util.h \
115+
src/gunicode.c \
116+
src/gunicode.h \
117+
src/hash-funcs.c \
118+
src/hash-funcs.h \
119+
src/hashmap.c \
120+
src/hashmap.h \
121+
src/hexdecoct.c \
122+
src/hexdecoct.h \
123+
src/hostname-util.c \
124+
src/hostname-util.h \
125+
src/io-util.c \
126+
src/io-util.h \
127+
src/list.h \
128+
src/log.c \
129+
src/log.h \
130+
src/login-util.c \
131+
src/login-util.h \
132+
src/macro.h \
133+
src/mempool.c \
134+
src/mempool.h \
135+
src/missing.h \
136+
src/parse-util.c \
137+
src/parse-util.h \
138+
src/path-util.c \
139+
src/path-util.h \
140+
src/process-util.c \
141+
src/process-util.h \
142+
src/random-util.c \
143+
src/random-util.h \
144+
src/_sd-common.h \
145+
src/sd-messages.h \
146+
src/set.h \
147+
src/siphash24.c \
148+
src/siphash24.h \
149+
src/socket-util.c \
150+
src/socket-util.h \
151+
src/special.h \
152+
src/stdio-util.h \
153+
src/string-table.c \
154+
src/string-table.h \
155+
src/string-util.c \
156+
src/string-util.h \
157+
src/strv.c \
158+
src/strv.h \
159+
src/strxcpyx.c \
160+
src/strxcpyx.h \
161+
src/terminal-util.c \
162+
src/terminal-util.h \
163+
src/time-util.c \
164+
src/time-util.h \
165+
src/umask-util.h \
166+
src/unaligned.h \
167+
src/unit.h \
168+
src/unit-name.c \
169+
src/unit-name.h \
170+
src/user-util.c \
171+
src/user-util.h \
172+
src/utf8.c \
173+
src/utf8.h \
174+
src/util.c \
175+
src/util.h \
176+
src/virt.c \
177+
src/virt.h
178+
179+
libutils_la_CFLAGS = \
180+
$(AM_CFLAGS) \
181+
$(LIBSYSTEMD_JOURNAL_CFLAGS)
182+
183+
libutils_la_LIBADD = \
184+
$(LIBSYSTEMD_JOURNAL_LIBS)
185+
186+
noinst_LTLIBRARIES = libutils.la
187+
188+
#####################################################
189+
190+
systemd_bootchart_SOURCES = \
191+
src/bootchart.c \
192+
src/bootchart.h \
193+
src/store.c \
194+
src/store.h \
195+
src/svg.c \
196+
src/svg.h
197+
198+
systemd_bootchart_LDADD = \
199+
libutils.la
200+
201+
#####################################################
202+
203+
substitutions = \
204+
'|rootlibexecdir=$(rootlibexecdir)|'
205+
206+
SED_PROCESS = \
207+
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
208+
$(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
209+
< $< > $@
210+
211+
units/%: units/%.in
212+
$(SED_PROCESS)
213+
214+
man/%: man/%.in
215+
$(SED_PROCESS)
216+
217+
rootlibexec_PROGRAMS = systemd-bootchart
218+
dist_pkgsysconf_DATA = src/bootchart.conf
219+
nodist_systemunit_DATA = units/systemd-bootchart.service
220+
221+
in_files = $(filter %.in,$(EXTRA_DIST))
222+
223+
CLEANFILES = \
224+
$(MANPAGES) $(MANPAGES_ALIAS) \
225+
$(pkgconfigdata_DATA) \
226+
$(pkgconfiglib_DATA) \
227+
$(in_files:.in=)
228+
229+
install-exec-hook: $(INSTALL_EXEC_HOOKS)
230+
231+
uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
232+
233+
install-data-hook: $(INSTALL_DATA_HOOKS)
234+
235+
.PHONY: git-tag
236+
git-tag:
237+
git tag -s "v$(VERSION)" -m "systemd $(VERSION)"
238+
239+
.PHONY: git-tar
240+
git-tar:
241+
git archive --format=tar --prefix=systemd-$(VERSION)/ HEAD | xz > systemd-$(VERSION).tar.xz

README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
For systemd-bootchart, several proc debug interfaces are required in the kernel config:
2+
CONFIG_SCHEDSTATS
3+
CONFIG_SCHED_DEBUG

TODO

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- plot per-process IO utilization
2+
- group processes based on service association (cgroups)
3+
- document initcall_debug
4+
- kernel cmdline "bootchart" option for simplicity?

autogen.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/sh
2+
3+
# This file is part of systemd-journal-remote.
4+
#
5+
# systemd is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU Lesser General Public License as published by
7+
# the Free Software Foundation; either version 2.1 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# systemd is distributed in the hope that it will be useful, but
11+
# WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
# Lesser General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU Lesser General Public License
16+
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
17+
18+
set -e
19+
20+
oldpwd=$(pwd)
21+
topdir=$(dirname $0)
22+
cd $topdir
23+
24+
if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then
25+
# This part is allowed to fail
26+
cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
27+
chmod +x .git/hooks/pre-commit && \
28+
echo "Activated pre-commit hook." || :
29+
fi
30+
31+
intltoolize --force --automake
32+
autoreconf --force --install --symlink
33+
34+
libdir() {
35+
echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd)
36+
}
37+
38+
args="\
39+
--sysconfdir=/etc \
40+
--localstatedir=/var \
41+
--libdir=$(libdir /usr/lib) \
42+
"
43+
44+
if [ -f "$topdir/.config.args" ]; then
45+
args="$args $(cat $topdir/.config.args)"
46+
fi
47+
48+
if [ ! -L /bin ]; then
49+
args="$args \
50+
--with-rootprefix=/ \
51+
--with-rootlibdir=$(libdir /lib) \
52+
"
53+
fi
54+
55+
cd $oldpwd
56+
57+
if [ "x$1" = "xc" ]; then
58+
$topdir/configure CFLAGS='-g -O0 -ftrapv' $args
59+
make clean
60+
else
61+
echo
62+
echo "----------------------------------------------------------------"
63+
echo "Initialized build system. For a common configuration please run:"
64+
echo "----------------------------------------------------------------"
65+
echo
66+
echo "$topdir/configure CFLAGS='-g -O0 -ftrapv' $args"
67+
echo
68+
fi

0 commit comments

Comments
 (0)