Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (9666e5568810fc015769dcc185119d581d73b289)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Vlad Glagolev <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (9666e5568810fc015769dcc185119d581d73b289)
  • Date: Sun, 18 Aug 2019 02:08:42 +0000

GIT changes to master grimoire by Vlad Glagolev <stealth AT sourcemage.org>:

ChangeLog | 3 ++
utils/perf/BUILD | 11 ++++++++++
utils/perf/DEPENDS | 55
+++++++++++++++++++++++++++++++++++++++++++++++++++
utils/perf/DETAILS | 14 ++++++++++++
utils/perf/HISTORY | 3 ++
utils/perf/INSTALL | 11 ++++++++++
utils/perf/PREPARE | 7 ++++++
utils/perf/PRE_BUILD | 18 ++++++++++++++++
utils/perf/TRIGGERS | 1
utils/perf/elf.patch | 23 +++++++++++++++++++++
10 files changed, 146 insertions(+)

New commits:
commit 9666e5568810fc015769dcc185119d581d73b289
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

perf: new spell, Linux performance analyzing tool

diff --git a/ChangeLog b/ChangeLog
index 8f6bb2f..dc0bdd1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2019-08-17 Vlad Glagolev <stealth AT sourcemage.org>
+ * utils/perf: new spell, Linux performance analyzing tool
+
2019-08-14 Eric Sandall <sandalle AT sourcemage.org>
* utils/hivex: new spell, a library for editing Windows Registry hive
files

diff --git a/utils/perf/BUILD b/utils/perf/BUILD
new file mode 100755
index 0000000..855971c
--- /dev/null
+++ b/utils/perf/BUILD
@@ -0,0 +1,11 @@
+cd "${SOURCE_DIRECTORY}/perf" &&
+
+local _targets="all" &&
+
+if is_depends_enabled ${SPELL} asciidoc; then
+ _targets="all man"
+fi &&
+
+make CFLAGS="${CFLAGS}" EXTRA_CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
+ V=1 WERROR=0 DESTDIR="${INSTALL_ROOT}" prefix=/usr lib=lib/perf \
+ ${OPTS} $_targets
diff --git a/utils/perf/DEPENDS b/utils/perf/DEPENDS
new file mode 100755
index 0000000..9408465
--- /dev/null
+++ b/utils/perf/DEPENDS
@@ -0,0 +1,55 @@
+optional_depends gtk+2 \
+ "NO_GTK=" \
+ "NO_GTK=1" \
+ "for GTK+2 support" &&
+
+optional_depends audit \
+ "NO_LIBAUDIT=" \
+ "NO_LIBAUDIT=1" \
+ "for trace tool support" &&
+
+optional_depends LIBELF \
+ "NO_LIBELF=" \
+ "NO_LIBELF=1" \
+ "for probe tool support" &&
+
+optional_depends perl \
+ "NO_LIBPERL=" \
+ "NO_LIBPERL=1" \
+ "for Perl scripting support" &&
+
+optional_depends python \
+ "NO_LIBPYTHON=" \
+ "NO_LIBPYTHON=1" \
+ "for Python support" &&
+
+optional_depends slang \
+ "NO_SLANG=" \
+ "NO_SLANG=1" \
+ "for TUI support" &&
+
+optional_depends SSL \
+ "NO_LIBCRYPTO=" \
+ "NO_LIBCRYPTO=1" \
+ "for jitted code injection" &&
+
+optional_depends libunwind \
+ "NO_LIBUNWIND=" \
+ "NO_LIBUNWIND=1" \
+ "for post unwind support" &&
+
+optional_depends zlib \
+ "NO_ZLIB=" \
+ "NO_ZLIB=1" \
+ "for kernel module decompression support" &&
+
+optional_depends xz-utils \
+ "NO_LZMA=" \
+ "NO_LZMA=1" \
+ "for xz kernel module decompression support" &&
+
+optional_depends asciidoc "" "" "to build documentation" &&
+
+if is_depends_enabled ${SPELL} asciidoc; then
+ depends xmlto
+fi
diff --git a/utils/perf/DETAILS b/utils/perf/DETAILS
new file mode 100755
index 0000000..0ca8901
--- /dev/null
+++ b/utils/perf/DETAILS
@@ -0,0 +1,14 @@
+ SPELL=perf
+ VERSION=$(uname -r)
+SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
+ WEB_SITE=https://perf.wiki.kernel.org/
+ ENTERED=20190817
+ LICENSE=GPL
+ KEYWORDS="kernel"
+ SHORT="Linux performance analyzing tool"
+cat << EOF
+Perf is a profiler tool for Linux 2.6+ based systems that abstracts away CPU
+hardware differences in Linux performance measurements and presents a simple
+commandline interface. Perf is based on the perf_events interface exported by
+recent versions of the Linux kernel.
+EOF
diff --git a/utils/perf/HISTORY b/utils/perf/HISTORY
new file mode 100644
index 0000000..76b89cb
--- /dev/null
+++ b/utils/perf/HISTORY
@@ -0,0 +1,3 @@
+2019-08-17 Vlad Glagolev <stealth AT sourcemage.org>
+ * DETAILS, DEPENDS, {PRE_,}BUILD, INSTALL, PREPARE, TRIGGERS,
+ elf.patch: created spell, version synced with running kernel
diff --git a/utils/perf/INSTALL b/utils/perf/INSTALL
new file mode 100755
index 0000000..fb62904
--- /dev/null
+++ b/utils/perf/INSTALL
@@ -0,0 +1,11 @@
+cd "${SOURCE_DIRECTORY}/perf" &&
+
+local _targets="install" &&
+
+if is_depends_enabled ${SPELL} asciidoc; then
+ _targets="install install-man"
+fi &&
+
+make CFLAGS="${CFLAGS}" EXTRA_CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
+ V=1 WERROR=0 DESTDIR="${INSTALL_ROOT}" prefix=/usr lib=lib/perf \
+ ${OPTS} $_targets
diff --git a/utils/perf/PREPARE b/utils/perf/PREPARE
new file mode 100755
index 0000000..02cd6c1
--- /dev/null
+++ b/utils/perf/PREPARE
@@ -0,0 +1,7 @@
+if [ ! -d "${INSTALL_ROOT}/usr/src/linux/tools/perf" ]; then
+ message "\n${PROBLEM_COLOR}ERROR: Linux kernel sources under
${FILE_COLOR}${INSTALL_ROOT}/usr/src/linux${PROBLEM_COLOR} are required"
+ message "to build this spell, either install the
${SPELL_COLOR}linux${PROBLEM_COLOR} spell or unpack"
+ message "kernel sources matching your running kernel
manually.${DEFAULT_COLOR}\n"
+
+ return 1
+fi
diff --git a/utils/perf/PRE_BUILD b/utils/perf/PRE_BUILD
new file mode 100755
index 0000000..913c728
--- /dev/null
+++ b/utils/perf/PRE_BUILD
@@ -0,0 +1,18 @@
+mk_source_dir "${SOURCE_DIRECTORY}" &&
+cd "${SOURCE_DIRECTORY}" &&
+
+if grep -q Werror ../linux/tools/lib/bpf/Makefile; then
+ sedit "s:-Werror::" ../linux/tools/lib/bpf/Makefile
+fi &&
+
+ln -s ../linux/tools/perf perf &&
+
+cd perf &&
+
+if ! grep -q libdir_relative Makefile.perf; then
+ sedit "s:install_plugins:install_plugins libdir_relative=lib:"
Makefile.perf
+fi &&
+
+if ! grep -q "GELF_ST_VISIBILITY" util/symbol-elf.c; then
+ patch -p0 "${SPELL_DIRECTORY}/elf.patch"
+fi
diff --git a/utils/perf/TRIGGERS b/utils/perf/TRIGGERS
new file mode 100755
index 0000000..5c92593
--- /dev/null
+++ b/utils/perf/TRIGGERS
@@ -0,0 +1 @@
+on_cast linux cast_self
diff --git a/utils/perf/elf.patch b/utils/perf/elf.patch
new file mode 100644
index 0000000..e557cd3
--- /dev/null
+++ b/utils/perf/elf.patch
@@ -0,0 +1,23 @@
+--- util/symbol-elf.c.orig 2017-11-12 10:46:13.000000000 -0800
++++ util/symbol-elf.c 2019-08-17 14:48:59.906991518 -0700
+@@ -19,6 +19,20 @@
+ #define EM_AARCH64 183 /* ARM 64 bit */
+ #endif
+
++#ifndef ELF32_ST_VISIBILITY
++#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
++#endif
++
++/* For ELF64 the definitions are the same. */
++#ifndef ELF64_ST_VISIBILITY
++#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
++#endif
++
++/* How to extract information held in the st_other field. */
++#ifndef GELF_ST_VISIBILITY
++#define GELF_ST_VISIBILITY(val) ELF64_ST_VISIBILITY (val)
++#endif
++
+ typedef Elf64_Nhdr GElf_Nhdr;
+
+ #ifdef HAVE_CPLUS_DEMANGLE_SUPPORT



  • [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (9666e5568810fc015769dcc185119d581d73b289), Vlad Glagolev, 08/17/2019

Archive powered by MHonArc 2.6.24.

Top of Page