This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLUGIN=instrumentx | |
TEST=test | |
PLUGIN_CXX=g++ | |
PLUGIN_CXXFLAGS= -std=c++11 -Wall -fno-rtti -fPIC -I`$(PLUGIN_CXX) -print-file-name=plugin`/include | |
PLUGIN_LDFLAGS= -std=c++11 -Wall -shared | |
TEST_CC=gcc | |
TEST_CFLAGS= -Wall -finstrument-functions -fplugin=$(PLUGIN).so -fplugin-arg-$(PLUGIN)-config=./instrument-function-list.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/fmtlib/fmt | |
// Usage: g++ main.c && ./a.out | |
// -- #include <fmt.h> | |
// -- int main() { | |
// -- fmt::print("hello {}\n", 123); | |
// -- } | |
#define FMT_HEADER_ONLY | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <stdint.h> | |
/* -------------------- UNROLL ---------------------- */ | |
/* DO NOT use unroll without braces. */ | |
#define X5(inst) inst inst inst inst inst | |
#define X10(inst) X5(inst) X5(inst) | |
#define X50(inst) X10(inst) X10(inst) X10(inst) X10(inst) X10(inst) | |
#define X100(inst) X50(inst) X50(inst) | |
#define X500(inst) X100(inst) X100(inst) X100(inst) X100(inst) X100(inst) |