diff --git a/README.en.md b/README.en.md index 9b77a245d218f827e4689caddd18bd736e62d3df..abfc987db9962a2069c4f7a46ae17be32b0b0746 100644 --- a/README.en.md +++ b/README.en.md @@ -164,3 +164,21 @@ def Counting(): kperf.disable(pd) kperf.close(pd) ``` + +#### Quick Run Reference for Example Code: + +* **For C Example Code:** +You can place the example code inside a main function and include the relevant header files for the dynamic library (#include "symbol.h", #include "pmu.h", #include "pcerrc.h"). Then, compile and link the dynamic library using g++ to generate an executable file for running. + +Compilation Command Reference: +```bash +gcc -o main main.c -I /install_path/include -L /install_path/lib -lkperf -lsym +``` + +* **For Python Example Code:** +You can place the example code inside a main function and import the relevant packages for the dynamic library (import kperf, import ksym). Then, run the Python file directly. + +Run Command Reference: +```bash +python main.py +``` \ No newline at end of file diff --git a/README.md b/README.md index a2ec82773838e7426ff73869ebb85b34fd11bdb8..4b5fb2ccf52aa70d93e61408bb996160a9b74943 100644 --- a/README.md +++ b/README.md @@ -166,3 +166,18 @@ def Counting(): kperf.close(pd) ``` + +#### 示例代码快速运行参考: +* **针对C示例代码:** +可以将示例代码放到一个main函数中,并引用此动态库相关的头文件(#include "symbol.h"、#include "pmu.h"、#include "pcerrc.h"),在使用g++编译链接此动态库,生成可执行文件即可运行。 +编译指令参考: +```bash +gcc -o main main.c -I /install_path/include -L /install_path/lib -lkperf -lsym +``` + +* **针对python示例代码:** +可以将示例代码放到一个main函数中,并导入此动态库相关的头文件包(import kperf、import ksym),在运行此python文件即可。 +运行指令参考: +```bash +python main.py +``` \ No newline at end of file diff --git a/docs/Details.md b/docs/detail_usage.md similarity index 100% rename from docs/Details.md rename to docs/detail_usage.md