Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename project #223

Merged
merged 4 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ couscous.yml
.dockerignore
Dockerfile
.phpunit.result.cache
php-profiler.log
reli.log
vendor
lsp
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Coverage Status](https://coveralls.io/repos/github/reliforp/reli-prof/badge.svg?branch=0.6.x)](https://coveralls.io/github/reliforp/reli-prof?branch=0.6.x)
![Psalm coverage](https://shepherd.dev/github/reliforp/reli-prof/coverage.svg?)

Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the process. It's a stand alone CLI tool, so target programs don't need any modifications. The former name of this tool was sj-i/php-profiler (We are in the process of changing the name right now).
Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the process. It's a stand alone CLI tool, so target programs don't need any modifications. The former name of this tool was sj-i/php-profiler.

## What can I use this for?
- Detecting and visualizing bottlenecks in PHP scripts
Expand Down Expand Up @@ -233,23 +233,23 @@ $ ./reli i:trace -- php -r "fgets(STDIN);"
```bash
$ sudo php ./reli i:trace -p 2182685
0 time_nanosleep <internal>:-1
1 PhpProfiler\Lib\Loop\LoopMiddleware\NanoSleepMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/NanoSleepMiddleware.php:33
2 PhpProfiler\Lib\Loop\LoopMiddleware\KeyboardCancelMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/KeyboardCancelMiddleware.php:39
3 PhpProfiler\Lib\Loop\LoopMiddleware\RetryOnExceptionMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/RetryOnExceptionMiddleware.php:37
4 PhpProfiler\Lib\Loop\Loop::invoke /home/sji/work/reli/src/Lib/Loop/Loop.php:26
5 PhpProfiler\Command\Inspector\GetTraceCommand::execute /home/sji/work/reli/src/Command/Inspector/GetTraceCommand.php:133
1 Reli\Lib\Loop\LoopMiddleware\NanoSleepMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/NanoSleepMiddleware.php:33
2 Reli\Lib\Loop\LoopMiddleware\KeyboardCancelMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/KeyboardCancelMiddleware.php:39
3 Reli\Lib\Loop\LoopMiddleware\RetryOnExceptionMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/RetryOnExceptionMiddleware.php:37
4 Reli\Lib\Loop\Loop::invoke /home/sji/work/reli/src/Lib/Loop/Loop.php:26
5 Reli\Command\Inspector\GetTraceCommand::execute /home/sji/work/reli/src/Command/Inspector/GetTraceCommand.php:133
6 Symfony\Component\Console\Command\Command::run /home/sji/work/reli/vendor/symfony/console/Command/Command.php:291
7 Symfony\Component\Console\Application::doRunCommand /home/sji/work/reli/vendor/symfony/console/Application.php:979
8 Symfony\Component\Console\Application::doRun /home/sji/work/reli/vendor/symfony/console/Application.php:299
9 Symfony\Component\Console\Application::run /home/sji/work/reli/vendor/symfony/console/Application.php:171
10 <main> /home/sji/work/reli/reli:45

0 time_nanosleep <internal>:-1
1 PhpProfiler\Lib\Loop\LoopMiddleware\NanoSleepMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/NanoSleepMiddleware.php:33
2 PhpProfiler\Lib\Loop\LoopMiddleware\KeyboardCancelMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/KeyboardCancelMiddleware.php:39
3 PhpProfiler\Lib\Loop\LoopMiddleware\RetryOnExceptionMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/RetryOnExceptionMiddleware.php:37
4 PhpProfiler\Lib\Loop\Loop::invoke /home/sji/work/reli/src/Lib/Loop/Loop.php:26
5 PhpProfiler\Command\Inspector\GetTraceCommand::execute /home/sji/work/reli/src/Command/Inspector/GetTraceCommand.php:133
1 Reli\Lib\Loop\LoopMiddleware\NanoSleepMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/NanoSleepMiddleware.php:33
2 Reli\Lib\Loop\LoopMiddleware\KeyboardCancelMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/KeyboardCancelMiddleware.php:39
3 Reli\Lib\Loop\LoopMiddleware\RetryOnExceptionMiddleware::invoke /home/sji/work/reli/src/Lib/Loop/LoopMiddleware/RetryOnExceptionMiddleware.php:37
4 Reli\Lib\Loop\Loop::invoke /home/sji/work/reli/src/Lib/Loop/Loop.php:26
5 Reli\Command\Inspector\GetTraceCommand::execute /home/sji/work/reli/src/Command/Inspector/GetTraceCommand.php:133
6 Symfony\Component\Console\Command\Command::run /home/sji/work/reli/vendor/symfony/console/Command/Command.php:291
7 Symfony\Component\Console\Application::doRunCommand /home/sji/work/reli/vendor/symfony/console/Application.php:979
8 Symfony\Component\Console\Application::doRun /home/sji/work/reli/vendor/symfony/console/Application.php:299
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
"autoload": {
"files": ["src/Lib/Defer/defer.php"],
"psr-4": {
"PhpProfiler\\": "src"
"Reli\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"PhpProfiler\\": "tests"
"Reli\\": "tests"
}
},
"bin": [
Expand Down
4 changes: 2 additions & 2 deletions config/config.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
* This file is part of the reliforp/reli-prof package.
*
* (c) sji <[email protected]>
*
Expand All @@ -16,7 +16,7 @@
return [
'log' => [
'path' => [
'default' => 'php-profiler.log',
'default' => 'reli.log',
],
'level' => LogLevel::INFO,
],
Expand Down
48 changes: 24 additions & 24 deletions config/di.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
* This file is part of the reliforp/reli-prof package.
*
* (c) sji <[email protected]>
*
Expand All @@ -16,29 +16,29 @@
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Noodlehaus\Config;
use PhpProfiler\Inspector\Daemon\Reader\Worker\PhpReaderTraceLoop;
use PhpProfiler\Inspector\Daemon\Reader\Worker\PhpReaderTraceLoopInterface;
use PhpProfiler\Inspector\Output\TraceFormatter\Templated\TemplatePathResolver;
use PhpProfiler\Inspector\Output\TraceFormatter\Templated\TemplatePathResolverInterface;
use PhpProfiler\Lib\Amphp\ContextCreator;
use PhpProfiler\Lib\Amphp\ContextCreatorInterface;
use PhpProfiler\Lib\ByteStream\IntegerByteSequence\IntegerByteSequenceReader;
use PhpProfiler\Lib\ByteStream\IntegerByteSequence\LittleEndianReader;
use PhpProfiler\Lib\Elf\SymbolResolver\Elf64SymbolResolverCreator;
use PhpProfiler\Lib\Elf\SymbolResolver\SymbolResolverCreatorInterface;
use PhpProfiler\Lib\File\FileReaderInterface;
use PhpProfiler\Lib\File\NativeFileReader;
use PhpProfiler\Lib\Libc\Sys\Ptrace\Ptrace;
use PhpProfiler\Lib\Libc\Sys\Ptrace\PtraceX64;
use PhpProfiler\Lib\Log\StateCollector\CallerStateCollector;
use PhpProfiler\Lib\Log\StateCollector\GroupedStateCollector;
use PhpProfiler\Lib\Log\StateCollector\ProcessStateCollector;
use PhpProfiler\Lib\Log\StateCollector\StateCollector;
use PhpProfiler\Lib\PhpInternals\ZendTypeReader;
use PhpProfiler\Lib\Process\MemoryReader\MemoryReader;
use PhpProfiler\Lib\Process\MemoryReader\MemoryReaderInterface;
use PhpProfiler\Lib\Process\Search\ProcessSearcher;
use PhpProfiler\Lib\Process\Search\ProcessSearcherInterface;
use Reli\Inspector\Daemon\Reader\Worker\PhpReaderTraceLoop;
use Reli\Inspector\Daemon\Reader\Worker\PhpReaderTraceLoopInterface;
use Reli\Inspector\Output\TraceFormatter\Templated\TemplatePathResolver;
use Reli\Inspector\Output\TraceFormatter\Templated\TemplatePathResolverInterface;
use Reli\Lib\Amphp\ContextCreator;
use Reli\Lib\Amphp\ContextCreatorInterface;
use Reli\Lib\ByteStream\IntegerByteSequence\IntegerByteSequenceReader;
use Reli\Lib\ByteStream\IntegerByteSequence\LittleEndianReader;
use Reli\Lib\Elf\SymbolResolver\Elf64SymbolResolverCreator;
use Reli\Lib\Elf\SymbolResolver\SymbolResolverCreatorInterface;
use Reli\Lib\File\FileReaderInterface;
use Reli\Lib\File\NativeFileReader;
use Reli\Lib\Libc\Sys\Ptrace\Ptrace;
use Reli\Lib\Libc\Sys\Ptrace\PtraceX64;
use Reli\Lib\Log\StateCollector\CallerStateCollector;
use Reli\Lib\Log\StateCollector\GroupedStateCollector;
use Reli\Lib\Log\StateCollector\ProcessStateCollector;
use Reli\Lib\Log\StateCollector\StateCollector;
use Reli\Lib\PhpInternals\ZendTypeReader;
use Reli\Lib\Process\MemoryReader\MemoryReader;
use Reli\Lib\Process\MemoryReader\MemoryReaderInterface;
use Reli\Lib\Process\Search\ProcessSearcher;
use Reli\Lib\Process\Search\ProcessSearcherInterface;
use Psr\Log\LoggerInterface;
use function DI\autowire;

Expand Down
4 changes: 2 additions & 2 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset name="php-profiler">
<description>php-profiler conventions</description>
<ruleset name="reli">
<description>reli conventions</description>
<rule ref="PSR12"></rule>
</ruleset>
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ini name="memory_limit" value="512M"/>
</php>
<testsuites>
<testsuite name="php-profiler">
<testsuite name="reli">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
10 changes: 5 additions & 5 deletions reli
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
* This file is part of the reliforp/reli-prof package.
*
* (c) sji <[email protected]>
*
Expand All @@ -13,11 +13,11 @@
declare(strict_types=1);

use DI\ContainerBuilder;
use PhpProfiler\Command\CommandEnumerator;
use PhpProfiler\Lib\Log\Log;
use PhpProfiler\ReliProfiler;
use Reli\Command\CommandEnumerator;
use Reli\Lib\Log\Log;
use Reli\ReliProfiler;
use Psr\Log\LoggerInterface;
use PhpProfiler\Lib\Log\StateCollector\StateCollector;
use Reli\Lib\Log\StateCollector\StateCollector;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;

Expand Down
6 changes: 3 additions & 3 deletions resources/templates/compat.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
* This file is part of the reliforp/reli-prof package.
*
* (c) sji <[email protected]>
*
Expand All @@ -11,8 +11,8 @@

declare(strict_types=1);

use PhpProfiler\Inspector\Output\TraceFormatter\Compat\CompatCallTraceFormatter;
use PhpProfiler\Lib\PhpProcessReader\CallTrace;
use Reli\Inspector\Output\TraceFormatter\Compat\CompatCallTraceFormatter;
use Reli\Lib\PhpProcessReader\CallTrace;

/** @var CallTrace $call_trace */

Expand Down
4 changes: 2 additions & 2 deletions resources/templates/json_lines.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
* This file is part of the reliforp/reli-prof package.
*
* (c) sji <[email protected]>
*
Expand All @@ -11,7 +11,7 @@

declare(strict_types=1);

use PhpProfiler\Lib\PhpProcessReader\CallTrace;
use Reli\Lib\PhpProcessReader\CallTrace;
/** @var CallTrace $call_trace */
?>
<?= json_encode($call_trace, JSON_UNESCAPED_UNICODE) ?>
Expand Down
4 changes: 2 additions & 2 deletions resources/templates/phpspy.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
* This file is part of the reliforp/reli-prof package.
*
* (c) sji <[email protected]>
*
Expand All @@ -11,7 +11,7 @@

declare(strict_types=1);

use PhpProfiler\Lib\PhpProcessReader\CallTrace;
use Reli\Lib\PhpProcessReader\CallTrace;
/** @var CallTrace $call_trace */
?>
<?php foreach ($call_trace->call_frames as $depth => $frame): ?>
Expand Down
4 changes: 2 additions & 2 deletions resources/templates/phpspy_with_opcode.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
* This file is part of the reliforp/reli-prof package.
*
* (c) sji <[email protected]>
*
Expand All @@ -11,7 +11,7 @@

declare(strict_types=1);

use PhpProfiler\Lib\PhpProcessReader\CallTrace;
use Reli\Lib\PhpProcessReader\CallTrace;
/** @var CallTrace $call_trace */
$depth_offset = 0;
?>
Expand Down
6 changes: 3 additions & 3 deletions src/Command/CommandEnumerator.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
* This file is part of the reliforp/reli-prof package.
*
* (c) sji <[email protected]>
*
Expand All @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace PhpProfiler\Command;
namespace Reli\Command;

use FilesystemIterator;
use IteratorAggregate;
Expand All @@ -33,7 +33,7 @@ public function getIterator()
foreach ($this->command_files_iterator as $command_file_info) {
$class_name = $command_file_info->getBasename('.php');
$namespace = $command_file_info->getPathInfo()->getFilename();
$result = "PhpProfiler\\Command\\{$namespace}\\$class_name";
$result = "Reli\\Command\\{$namespace}\\$class_name";
assert(is_subclass_of($result, Command::class));
yield $result;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Command/Converter/FlameGraphCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
* This file is part of the reliforp/reli-prof package.
*
* (c) sji <[email protected]>
*
Expand All @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace PhpProfiler\Command\Converter;
namespace Reli\Command\Converter;

use Noodlehaus\Config;
use PhpCast\Cast;
Expand Down
12 changes: 6 additions & 6 deletions src/Command/Converter/SpeedscopeCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
* This file is part of the reliforp/reli-prof package.
*
* (c) sji <[email protected]>
*
Expand All @@ -11,13 +11,13 @@

declare(strict_types=1);

namespace PhpProfiler\Command\Converter;
namespace Reli\Command\Converter;

use PhpCast\Cast;
use PhpProfiler\Lib\PhpInternals\Opcodes\OpcodeV80;
use PhpProfiler\Lib\PhpInternals\Types\Zend\Opline;
use PhpProfiler\Lib\PhpProcessReader\CallFrame;
use PhpProfiler\Lib\PhpProcessReader\CallTrace;
use Reli\Lib\PhpInternals\Opcodes\OpcodeV80;
use Reli\Lib\PhpInternals\Types\Zend\Opline;
use Reli\Lib\PhpProcessReader\CallFrame;
use Reli\Lib\PhpProcessReader\CallTrace;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down
30 changes: 15 additions & 15 deletions src/Command/Inspector/DaemonCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the sj-i/php-profiler package.
* This file is part of the reliforp/reli-prof package.
*
* (c) sji <[email protected]>
*
Expand All @@ -11,23 +11,23 @@

declare(strict_types=1);

namespace PhpProfiler\Command\Inspector;
namespace Reli\Command\Inspector;

use Amp\Loop;
use Amp\Promise;
use PhpProfiler\Inspector\Daemon\Dispatcher\DispatchTable;
use PhpProfiler\Inspector\Daemon\Reader\Protocol\Message\TraceMessage;
use PhpProfiler\Inspector\Daemon\Dispatcher\WorkerPool;
use PhpProfiler\Inspector\Daemon\Reader\Context\PhpReaderContextCreator;
use PhpProfiler\Inspector\Daemon\Searcher\Context\PhpSearcherContextCreator;
use PhpProfiler\Inspector\Output\TraceOutput\TraceOutputFactory;
use PhpProfiler\Inspector\Settings\DaemonSettings\DaemonSettingsFromConsoleInput;
use PhpProfiler\Inspector\Settings\GetTraceSettings\GetTraceSettingsFromConsoleInput;
use PhpProfiler\Inspector\Settings\OutputSettings\OutputSettingsFromConsoleInput;
use PhpProfiler\Inspector\Settings\TargetPhpSettings\TargetPhpSettingsFromConsoleInput;
use PhpProfiler\Inspector\Settings\TraceLoopSettings\TraceLoopSettingsFromConsoleInput;
use PhpProfiler\Lib\Console\EchoBackCanceller;
use PhpProfiler\Lib\Log\Log;
use Reli\Inspector\Daemon\Dispatcher\DispatchTable;
use Reli\Inspector\Daemon\Reader\Protocol\Message\TraceMessage;
use Reli\Inspector\Daemon\Dispatcher\WorkerPool;
use Reli\Inspector\Daemon\Reader\Context\PhpReaderContextCreator;
use Reli\Inspector\Daemon\Searcher\Context\PhpSearcherContextCreator;
use Reli\Inspector\Output\TraceOutput\TraceOutputFactory;
use Reli\Inspector\Settings\DaemonSettings\DaemonSettingsFromConsoleInput;
use Reli\Inspector\Settings\GetTraceSettings\GetTraceSettingsFromConsoleInput;
use Reli\Inspector\Settings\OutputSettings\OutputSettingsFromConsoleInput;
use Reli\Inspector\Settings\TargetPhpSettings\TargetPhpSettingsFromConsoleInput;
use Reli\Inspector\Settings\TraceLoopSettings\TraceLoopSettingsFromConsoleInput;
use Reli\Lib\Console\EchoBackCanceller;
use Reli\Lib\Log\Log;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down
Loading