trace-cruncher: Add documentation for tracecruncher.ftracepy
PATCH 1/2 trace-cruncher: Add documentation for tracecruncher.ftracepy
Python style documentation for the 'ftracepy' submodule, based on pydocs, is added. To build the type 'sudo make doc'. Documentation for all other submodules of trace-cruncher will be added in following patches.
Signed-off-by Yordan Karadzhov (VMware) <[email protected]>
--- Makefile | 11 + README.md | 2 +- docs/setup.py | 36 ++ src/ftracepy-docs.h | 1416 +++++++++++++++++++++++++++++++++++++++++++ src/ftracepy.c | 182 +++--- 5 files changed, 1556 insertions(+), 91 deletions(-) create mode 100644 docs/setup.py create mode 100644 src/ftracepy-docs.h
Makefile +11 -0
@@ -5,11 +5,14 @@ # UID := $(shell id -u) +GID := $(shell id -g) CYAN := '\e[36m' PURPLE := '\e[35m' NC := '\e[0m' +DOCDIR = ./docs + all: @ echo ${CYAN}Buildinging trace-cruncher:${NC}; python3 setup.py build
@@ -31,3 +34,11 @@ uninstall: rm -rfv dist tracecruncher.egg-info; \ rm -fv install_manifest.txt; \ fi + +doc: + @ echo ${CYAN}Buildinging trace-cruncher documentation:${NC}; + @ python3 $(DOCDIR)/setup.py builtins + @ sudo python3 $(DOCDIR)/setup.py tracecruncher.ftracepy $(UID) $(GID) + +clean_doc: + @ rm -f $(DOCDIR)/*.html
README.md +1 -1
@@ -6,7 +6,7 @@ The Trace-Cruncher project aims to provide an interface between the existing instrumentation for collection and visualization of tracing data from the Linux kernel and the broad and very well developed ecosystem of instruments for data analysis available in Python. -The Trace-Cruncher allows for sophisticated analysis of kernel tracing data via scripts, but it also opens the door for exposing the kernel tracing data to the instruments provided by the scientific toolkit of Python like MatPlotLib, Stats, Scikit-Learn and even to the nowadays most popular frameworks for Machine Learning like TensorFlow and PyTorch. The Trace-Cruncher is strongly coupled to the [libtraceevent](https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git), [libtracefs](https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/) and [KernelShark](https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/) projects and is build on top of the C API of this librearies. +The Trace-Cruncher allows for sophisticated analysis of kernel tracing data via scripts, but it also opens the door for exposing the kernel tracing data to the instruments provided by the scientific toolkit of Python like MatPlotLib, Stats, Scikit-Learn and even to the nowadays most popular frameworks for Machine Learning like TensorFlow and PyTorch. The Trace-Cruncher is strongly coupled to the [libtraceevent](https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git), [libtracefs](https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/) and [KernelShark](https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/) projects and is build on top of the C API of these librearies. ## Try it out
docs/setup.py new file +36 -0
@@ -0,0 +1,36 @@ +#!/usr/bin/env python3 + +""" +SPDX-License-Identifier: LGPL-2.1 + +Copyright 2022 VMware Inc, Yordan Karadzhov (VMware) <[email protected]> +""" + +import pydoc +import sys +import os + +def main(): + path = os.path.abspath(sys.argv[0]) + d = os.path.dirname(path) + os.chdir(d) + + module = sys.argv[1] + pydoc.writedoc(module) + + doc_file = './' + module + '.html' + with open(doc_file, 'rt') as f: + data = f.read() + data = data.replace('#ee77aa', '#5577aa') + data = data.replace('#ffc8d8', '66c8d8') + data = data.replace('#eeaa77', '55aa77') + + with open(doc_file, 'wt') as f: + f.write(data) + + if len(sys.argv) == 4: + os.chown(doc_file, int(sys.argv[2]), int(sys.argv[3])) + + +if __name__ == '__main__': + main()
src/ftracepy-docs.h new file +1416 -0
1,416 lines not on this page · raw message
src/ftracepy.c +92 -90
570 lines not on this page · raw message
Signature · 1 line
2.32.0
PATCH 2/2 trace-cruncher: Add documentation for tracecruncher.ft_utils
Python style documentation for the 'ft_utils' submodule is added.
Signed-off-by Yordan Karadzhov (VMware) <[email protected]>
--- Makefile | 1 + tracecruncher/ft_utils.py | 625 +++++++++++++++++++++++++++++++++++--- 2 files changed, 578 insertions(+), 48 deletions(-)
Makefile +1 -0
@@ -39,6 +39,7 @@ doc: @ echo ${CYAN}Buildinging trace-cruncher documentation:${NC}; @ python3 $(DOCDIR)/setup.py builtins @ sudo python3 $(DOCDIR)/setup.py tracecruncher.ftracepy $(UID) $(GID) + @ sudo python3 $(DOCDIR)/setup.py tracecruncher.ft_utils $(UID) $(GID) clean_doc: @ rm -f $(DOCDIR)/*.html
tracecruncher/ft_utils.py +577 -48
888 lines not on this page · raw message
Signature · 1 line
2.32.0