From 76c9f730e6c3720c8d87f2b10904c0df6ba099af Mon Sep 17 00:00:00 2001 From: Przemek Delewski Date: Mon, 27 Feb 2023 15:24:41 +0100 Subject: [PATCH] adding usage to readme --- instrgen/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/instrgen/README.md b/instrgen/README.md index c60f0d25ed8..c5446a6b2b4 100644 --- a/instrgen/README.md +++ b/instrgen/README.md @@ -6,6 +6,32 @@ This package provides a code generation utility that instruments existing source :construction: This package is currently work in progress. +## How to use it + +In order to instrument your project you have to add following call in your entry point function, usually main +(you can look at tests directory for reference) and invoke instrgen tool. + +``` +func main() { + rtlib.AutotelEntryPoint() +``` + +Instrgen requires three parameters: command, path to project and package(s) pattern we +would like to instrument. + +``` +./instrgen --inject [path to your go project] [package(s) pattern] +``` + +Below concrete example with one of test instrumentation that is part of the project. + +``` +./instrgen --inject ./testdata/basic ./... +``` + +```./...``` works like wildcard in this case and it will instrument all packages in this path, but it can be invoked with +specific package as well. + ### Compatibility The `instrgen` utility is based on the Go standard library and is platform agnostic.