Skip to content

Commit

Permalink
Add example of build process for PGO supported binary vozlt#283
Browse files Browse the repository at this point in the history
  • Loading branch information
u5surf committed Jan 1, 2024
1 parent bd33883 commit 5a601a2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,37 @@ Earlier versions is not tested.

4. Install the nginx binary.

### Instralltion with Profile-Guided Optimization

It can be built with Profile-Guided Optimization (PGO) using gcc fprofile options. Here is an example of the process to make a PGO supported binary.

1. Compile with fprofile-generate.

```
shell> pwd
/somewhere/nginx
shell> CC=gcc ./auto/configure --with-cc-opt='-fprofile-generate -fprofile-dir=./objs' --with-ld-opt='-lgcov' --add-module=/somewhere/nginx-module-vts
shell> make
```

2. Execute this module tests.

```
shell> pwd
/somewhere/nginx-module-vts
shell> sudo PATH=/somewhere/nginx/objs:$PATH prove -r t/000.display_html.t
...(during runtime it records coverage data into .gcda files)
```

3. Recompile with fprofile-use

```
shell> pwd
/somewhere/nginx
shell> CC=gcc ./auto/configure --with-cc-opt='-fprofile-use -fprofile-dir=/somewhere/nginx-module-vts/objs' --with-ld-opt='-lgcov' --add-module=/somewhere/nginx-module-vts
shell> make
```

## Synopsis

```Nginx
Expand Down

0 comments on commit 5a601a2

Please sign in to comment.