Skip to content

Commit f2ec806

Browse files
committed
Update README and add CHANGELOG
1 parent 210876d commit f2ec806

File tree

2 files changed

+63
-9
lines changed

2 files changed

+63
-9
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changelog
2+
3+
## [v0.3]
4+
5+
Improvements in Session Tracing:
6+
- Fixed PL/pgSQL function tracing – now works correctly.
7+
- Added PID at the start of the file for better trace identification.
8+
- Added query start time for precise timing analysis.
9+
- Improved format for nested queries (better readability and structure).
10+
- Updated documentation and JSON Schema for session trace output format.
11+
12+
Other Changes:
13+
- Fixed stat_hist_uprobe SQL function (resolved known issues).
14+
- Added test suite for the extension:
15+
Tests are written in Python using the testgres library.
16+
Prerequisites:
17+
1. Ensure PG_CONFIG environment variable points to the pg_config executable.
18+
2. Run make python_tests to execute the tests.
19+
- Added FreeBSD support.
20+
- Upgraded Frida-Gum to version 17.1.5.

README.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
- [Build](#build)
1111
- [Configuration](#configuration)
1212
- [Creating the Extension](#creating-the-extension)
13+
- [Tests] (#tests)
1314
- [Settings](#settings)
1415
- [Usage](#usage)
1516
- [Usage Examples](#usage-examples)
17+
- [Code branching model](#code-branching-model)
1618

1719
# pg_uprobe
1820
A PostgreSQL extension designed for tracing and analyzing queries executed within a session. This extension allows to capture and log information about running queries inside session. The collected information can retrieve heavy operations and most consumed resources during the execution of specific SQL queries.
@@ -62,12 +64,17 @@ Supported PostgreSQL versions:
6264

6365
Supported architectures:
6466

65-
- x86
66-
- (We are working on supporting more architectures)
67+
|Informal name|Name in RPM and Linux kernel|Name in Debian and Astra|Features of hardware platform support|
68+
|------------|------------|------------|------------|
69+
|Intel compatible 64-bit|x86_64|amd64||
70+
|ARM 64-bit|aarch64|arm64|| Not tested, but Frida library supports this architecture
71+
72+
(We are working on supporting more architectures)
6773

6874
Supported operating systems:
6975

7076
- Linux
77+
- FreeBSD
7178

7279
### Session Tracing
7380

@@ -113,8 +120,7 @@ Requirements:
113120

114121
The installation process involves the following steps:
115122

116-
- Download Frida sources
117-
- Build the Frida library
123+
- Download Frida library
118124
- Build the extension itself
119125

120126
### Build
@@ -149,6 +155,14 @@ postgres=# CREATE EXTENSION pg_uprobe SCHEMA uprobe;
149155
```
150156
We recommend installation in a dedicated schema. All objects will be created in the schema specified by the `SCHEMA` clause. If you do not want to specify the schema qualifier when using the extension, consider modifying the `search_path` parameter.
151157

158+
## Tests
159+
The tests are written in Python using the testgres framework. To run the tests, you need to install the testgres package for Python and set the PG_CONFIG environment variable to the path to the pg_config executable of your PostgreSQL installation.
160+
Running tests:
161+
162+
```shell
163+
make PG_CONFIG=/opt/pgpro/ent-15/bin/pg_config python_tests
164+
```
165+
152166
## Settings
153167

154168
- **pg_uprobe.data_dir** - Path to the directory where the session trace results file and function profiling results files are created. Default: `$PGDATA/pg_uprobe`
@@ -171,6 +185,9 @@ Simple example of [session tracing](doc/example_trace_session.md)
171185

172186
Simple example of [profiling PostgreSQL functions](doc/example_profile_func.md)
173187

188+
## Code branching model
189+
190+
**GitFlow** is used as the main code branching model in the git repository.
174191

175192
==============================<<<RU>>>==============================
176193

@@ -221,11 +238,17 @@ Simple example of [profiling PostgreSQL functions](doc/example_profile_func.md)
221238
- [Postgres Pro Enterprise 15/16/17](https://postgrespro.ru/products/postgrespro/enterprise)
222239

223240
Поддерживаемые архитектуры:
224-
- x86
225-
- (Мы работаем над поддержкой большего количества архитектур)
241+
242+
|Неформальное название|Название в RPM и Linux kernel|Название в Debian и Astra|Особенности поддержки аппаратных платформ|
243+
|------------|------------|------------|------------|
244+
|Интел-совместимые 64-бит|x86_64|amd64||
245+
|ARM 64-битные|aarch64|arm64|| Не тестировалось, но библиотека Frida поддерживает данную архитектуру
246+
247+
(Мы работаем над поддержкой большего количества архитектур)
226248

227249
Поддерживаемые операционные системы:
228250
- Linux
251+
- FreeBSD
229252

230253
### Трассирование сеансов
231254
При трассировании сеансов время выполнения запросов может увеличиться. В наших измерениях скорость выполнения падает на ~5%. Поэтому не стоит оставлять трассирование сеансов на длительное время. Этот инструмент предназначен, в первую очередь, для исследования проблемы, а не её обнаружения.
@@ -268,8 +291,7 @@ nm -D --demangle /opt/pgpro/ent-15/bin/postgres | awk '{ print $NF }'
268291
- python
269292

270293
В процессе установки будут выполнены следующие шаги:
271-
- Скачиваются исходники Frida
272-
- Собирается библиотека Frida
294+
- Скачиваются библиотека Frida
273295
- Собирается само расширение
274296

275297
### Сборка
@@ -304,6 +326,14 @@ postgres=# CREATE EXTENSION pg_uprobe SCHEMA uprobe;
304326
```
305327
Все объекты будут созданы в схеме, определенной предложением SCHEMA. Рекомендуется установка в выделенную схему где расширение создаст свои собственные функции. Если вы не хотите указывать квалификатор схемы при использовании расширения, рассмотрите возможность изменения параметра search_path.
306328

329+
## Способы тестирования
330+
Тесты написаны на языке Python с использованием фреймворка testgres. Для запуска тестов необходимо установить пакет testgres для Python и установить переменную окружения PG_CONFIG в путь до исполняемого файла pg_config вашего установленного PostgreSQL.
331+
Запуск тестов:
332+
333+
```shell
334+
make PG_CONFIG=/opt/pgpro/ent-15/bin/pg_config python_tests
335+
```
336+
307337
## Настройки
308338

309339
- **pg_uprobe.data_dir** - Путь к каталогу, в котором будет создаваться файл с результатами трассирования сеанса и файлы с результатами профилирования функций. По умолчанию: `$PGDATA/pg_uprobe`
@@ -323,4 +353,8 @@ postgres=# CREATE EXTENSION pg_uprobe SCHEMA uprobe;
323353

324354
Простой пример использования [трассирования сеанса](doc/example_trace_session.md)
325355

326-
Простой пример использования [профилирования функций PostgreSQL](doc/example_profile_func.md)
356+
Простой пример использования [профилирования функций PostgreSQL](doc/example_profile_func.md)
357+
358+
## Модель ветвления кода
359+
360+
В качестве основной модели ветвления кода в git-репозитории используется **gitFlow**

0 commit comments

Comments
 (0)