From 52507059a7ade17fd831f891eecca8aca6b9f903 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 10 Nov 2016 17:19:43 -0500 Subject: [PATCH] Claim to generate ANSI C code Signed-off-by: Philippe Proulx --- README.md | 30 ++++++++++++------- .../Makefile.barectf-linux-fs | 2 +- .../Makefile.barectf-qemu-arm-uart | 2 +- .../barectf-tracepoint/Makefile.lttng-ust | 2 +- doc/examples/linux-fs-simple/Makefile | 2 +- doc/examples/parallella/Makefile | 2 +- setup.py | 2 +- 7 files changed, 25 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 33391e5..c0db8f4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![](https://img.shields.io/pypi/v/barectf.svg)](https://pypi.python.org/pypi/barectf) [![Jenkins](https://img.shields.io/jenkins/s/https/ci.lttng.org/barectf_master_build.svg)](https://ci.lttng.org/job/barectf_master_build) -**barectf** is a command-line utility which generates C99 +**barectf** is a command-line utility which generates ANSI C code that is able to write native [Common Trace Format](http://diamon.org/ctf) (CTF) binary streams. @@ -24,7 +24,8 @@ You will find barectf interesting if: The target audience of barectf is developers who need to trace bare metal systems (without an operating system). The code produced by barectf -is pure C99 and can be lightweight enough to fit on a tiny microcontroller. +is pure ANCI C (with one exception, see the current limitations below) +and can be lightweight enough to fit on a tiny microcontroller. **Key features**: @@ -55,15 +56,22 @@ As of this version: stream-specific context, need to be called from the same thread, and cannot be called from an interrupt handler, unless a user-provided synchronization mechanism is used. - * CTF compound types (array, sequence, structure, variant) are not supported - yet, except at some very specific locations in the metadata. - * The current generated C code is not strictly C99 compliant: - [statement expressions](https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html) - and the - [`typeof` keyword](https://gcc.gnu.org/onlinedocs/gcc/Typeof.html) - GCC extensions are used in the generated bitfield macros. The - generated C code is known to be compiled with no warnings using - both GCC and Clang. + * The generated C code needs the `stdint.h` header, which is new in + C99. If your standard C library does not have this header, + you can create one yourself and put it in one of your include + directories to define the following types according to your + architecture: + * `int8_t` + * `int16_t` + * `int32_t` + * `int64_t` + * `uint8_t` + * `uint16_t` + * `uint32_t` + * `uint64_t` + * CTF compound types (array, sequence, structure, variant) are not + supported yet, except at some very specific locations in the + metadata. barectf is written in Python 3. diff --git a/doc/examples/barectf-tracepoint/Makefile.barectf-linux-fs b/doc/examples/barectf-tracepoint/Makefile.barectf-linux-fs index 99be68f..04f95fb 100644 --- a/doc/examples/barectf-tracepoint/Makefile.barectf-linux-fs +++ b/doc/examples/barectf-tracepoint/Makefile.barectf-linux-fs @@ -26,7 +26,7 @@ MKDIR = mkdir -p PLATFORM_DIR = ../../../platforms/linux-fs EXTRA_DIR = ../../../extra -CFLAGS = -O2 -Wall -pedantic -std=gnu99 -I$(PLATFORM_DIR) -I$(EXTRA_DIR) -I. +CFLAGS = -O2 -Wall -pedantic -I$(PLATFORM_DIR) -I$(EXTRA_DIR) -I. VERSION = linux-fs TARGET = barectf-tracepoint-barectf-$(VERSION) diff --git a/doc/examples/barectf-tracepoint/Makefile.barectf-qemu-arm-uart b/doc/examples/barectf-tracepoint/Makefile.barectf-qemu-arm-uart index e666e9e..c55e8d3 100644 --- a/doc/examples/barectf-tracepoint/Makefile.barectf-qemu-arm-uart +++ b/doc/examples/barectf-tracepoint/Makefile.barectf-qemu-arm-uart @@ -30,7 +30,7 @@ CC = $(ARCH)-gcc VERSION = qemu-arm-uart CPU=arm926ej-s EXTRA_DIR = ../../../extra -CFLAGS = -DWITH_QEMU_ARM_UART=1 -ffunction-sections -mcpu=$(CPU) -O2 -Wall -pedantic -std=gnu99 -I$(EXTRA_DIR) -I. +CFLAGS = -DWITH_QEMU_ARM_UART=1 -ffunction-sections -mcpu=$(CPU) -O2 -Wall -pedantic -I$(EXTRA_DIR) -I. LDFLAGS= -T barectf-platform-$(VERSION).ld -lc -lnosys TARGET = barectf-tracepoint-barectf-$(VERSION) diff --git a/doc/examples/barectf-tracepoint/Makefile.lttng-ust b/doc/examples/barectf-tracepoint/Makefile.lttng-ust index 30630b5..2612afb 100644 --- a/doc/examples/barectf-tracepoint/Makefile.lttng-ust +++ b/doc/examples/barectf-tracepoint/Makefile.lttng-ust @@ -22,7 +22,7 @@ RM = rm -rf -CFLAGS := -O2 -Wall -pedantic -std=gnu99 $(CFLAGS) +CFLAGS := -O2 -Wall -pedantic $(CFLAGS) LDFLAGS := -llttng-ust -ldl $(LDFLAGS) TARGET = barectf-tracepoint-lttng-ust diff --git a/doc/examples/linux-fs-simple/Makefile b/doc/examples/linux-fs-simple/Makefile index 041a26b..0eab932 100644 --- a/doc/examples/linux-fs-simple/Makefile +++ b/doc/examples/linux-fs-simple/Makefile @@ -25,7 +25,7 @@ RM = rm -rf MKDIR = mkdir PLATFORM_DIR = ../../../platforms/linux-fs -CFLAGS = -O2 -Wall -pedantic -std=gnu99 -I$(PLATFORM_DIR) -I. +CFLAGS = -O2 -Wall -pedantic -I$(PLATFORM_DIR) -I. TARGET = linux-fs-simple OBJS = $(TARGET).o barectf.o barectf-platform-linux-fs.o diff --git a/doc/examples/parallella/Makefile b/doc/examples/parallella/Makefile index 837e5e1..d360886 100644 --- a/doc/examples/parallella/Makefile +++ b/doc/examples/parallella/Makefile @@ -32,7 +32,7 @@ OBJCOPY=$(CROSS_COMPILE)objcopy ESDK=$(EPIPHANY_HOME) ELDF=$(ESDK)/bsps/current/fast.ldf PLATFORM_DIR = ../../../platforms/parallella -CFLAGS = -O2 -Wall -pedantic -std=c99 -I$(PLATFORM_DIR) -I. +CFLAGS = -O2 -Wall -pedantic -I$(PLATFORM_DIR) -I. LDFLAGS = -T $(ELDF) -le-lib TARGET = parallella diff --git a/setup.py b/setup.py index 494967e..caaaf7c 100755 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ import barectf setup(name='barectf', version=barectf.__version__, - description='Generator of C99 code that can write native CTF', + description='Generator of ANSI C code that can write native CTF', author='Philippe Proulx', author_email='eeppeliteloop@gmail.com', license='MIT', -- 2.34.1