-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
168 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--TEST-- | ||
Perfidious\Handle::rawStream() - do dirty things part 2 | ||
--EXTENSIONS-- | ||
perfidious | ||
--FILE-- | ||
<?php | ||
$handle = Perfidious\open([ | ||
"perf::PERF_COUNT_SW_CPU_CLOCK:u", | ||
"perf::PERF_COUNT_SW_PAGE_FAULTS:u", | ||
"perf::PERF_COUNT_SW_CONTEXT_SWITCHES:u", | ||
]); | ||
$stream = $handle->rawStream(2); | ||
var_dump(strlen(fread($stream, 32))); | ||
fclose($stream); | ||
var_dump($handle->read()); | ||
--EXPECTF-- | ||
int(32) | ||
%A Uncaught Perfidious\IOException: failed to read: Illegal seek %A | ||
%A Uncaught Perfidious\IOException: close failed: Bad file descriptor %A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--TEST-- | ||
Perfidious\Handle::rawStream() - do dirty things part 3 | ||
--EXTENSIONS-- | ||
perfidious | ||
--FILE-- | ||
<?php | ||
$handle = Perfidious\open([ | ||
"perf::PERF_COUNT_SW_CPU_CLOCK:u", | ||
]); | ||
$stream = $handle->rawStream(); | ||
var_dump(strlen(fread($stream, 32))); | ||
fclose($stream); | ||
try { | ||
var_dump($handle->enable()); | ||
} catch (\Throwable $e) { | ||
var_dump($e->getMessage()); | ||
} | ||
try { | ||
var_dump($handle->disable()); | ||
} catch (\Throwable $e) { | ||
var_dump($e->getMessage()); | ||
} | ||
try { | ||
var_dump($handle->reset()); | ||
} catch (\Throwable $e) { | ||
var_dump($e->getMessage()); | ||
} | ||
--EXPECTF-- | ||
int(32) | ||
string(%d) "ioctl failed: Bad file descriptor" | ||
string(%d) "ioctl failed: Bad file descriptor" | ||
string(%d) "ioctl failed: Bad file descriptor" | ||
%A Uncaught Perfidious\IOException: close failed: Bad file descriptor %A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
Perfidious\Handle::open() - invalid event name 2 | ||
--EXTENSIONS-- | ||
perfidious | ||
--FILE-- | ||
<?php | ||
$rv = Perfidious\open([ | ||
"perf::PERF_COUNT_SW_CPU_CLOCK:u", | ||
"perf::PERF_COUNT_SW_PAGE_FAULTS:u", | ||
"perf::PERF_COUNT_SW_CONTEXT_SWITCHES:u", | ||
"blahblahblah", | ||
]); | ||
--EXPECTF-- | ||
%A Uncaught Perfidious\PmuEventNotFoundException: failed to get libpfm event encoding for blahblahblah: event not found %A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--TEST-- | ||
info | ||
phpinfo global and per-request stats | ||
--EXTENSIONS-- | ||
perfidious | ||
--INI-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--TEST-- | ||
phpinfo global stats - closed fd | ||
--EXTENSIONS-- | ||
perfidious | ||
--INI-- | ||
perfidious.global.enable=1 | ||
perfidious.global.metrics=perf::PERF_COUNT_SW_CPU_CLOCK:u,perf::PERF_COUNT_SW_PAGE_FAULTS:u,perf::PERF_COUNT_SW_CONTEXT_SWITCHES:u | ||
--FILE-- | ||
<?php | ||
$handle = Perfidious\global_handle(); | ||
fclose($handle->rawStream()); | ||
phpinfo(INFO_MODULES); | ||
// looks like the second error is happening during mshutdown and doesn't get printed? | ||
--EXPECTF-- | ||
%A READ ERROR %A | ||
%A Uncaught Perfidious\IOException: failed to read: Bad file descriptor %A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--TEST-- | ||
phpinfo global stats - invalid event name | ||
--EXTENSIONS-- | ||
perfidious | ||
--INI-- | ||
perfidious.global.enable=1 | ||
perfidious.global.metrics=blahblahblah | ||
--FILE-- | ||
<?php | ||
phpinfo(INFO_MODULES); | ||
--EXPECTF-- | ||
%AWarning: PHP Startup: failed to get libpfm event encoding for blahblahblah: event not found%A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--TEST-- | ||
info | ||
phpinfo global stats | ||
--EXTENSIONS-- | ||
perfidious | ||
--INI-- | ||
|
Oops, something went wrong.