Granulate / gprofiler

gProfiler is a system-wide profiler, combining multiple sampling profilers to produce unified visualization of what your CPU is spending time on.
https://profiler.granulate.io
Apache License 2.0
743 stars 54 forks source link

phpspy: alpine: Phpspy usage of grep is not compatible with alpine #794

Open mpozniak95 opened 1 year ago

mpozniak95 commented 1 year ago

Phpspy uses grep with flag -P which is not compatible with alpine grep. Similar to https://github.com/Granulate/gprofiler/issues/636. Profiling php process on alpine with gprofiler executable results with:

grep: unrecognized option: P
BusyBox v1.36.0 (2023-05-05 06:41:49 UTC) multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A|B|C N] { PATTERN | -e PATTERN... | -f FILE... } [FILE]...

Search for PATTERN in FILEs (or stdin)

    -H  Add 'filename:' prefix
    -h  Do not add 'filename:' prefix
    -n  Add 'line_no:' prefix
    -l  Show only names of files that match
    -L  Show only names of files that don't match
    -c  Show only count of matching lines
    -o  Show only the matching part of line
    -q  Quiet. Return 0 if PATTERN is found, 1 otherwise
    -v  Select non-matching lines
    -s  Suppress open and read errors
    -r  Recurse
    -R  Recurse and dereference symlinks
    -i  Ignore case
    -w  Match whole words only
    -x  Match whole lines only
    -F  PATTERN is a literal (not regexp)
    -E  PATTERN is an extended regexp
    -m N    Match up to N times per file
    -A N    Print N lines of trailing context
    -B N    Print N lines of leading context
    -C N    Same as '-A N -B N'
    -e PTRN Pattern to match
    -f FILE Read pattern from file
strings: standard output: Broken pipe

Found during testing running gprofiler exe in Alpine container: https://github.com/Granulate/gprofiler/actions/runs/4977636154/jobs/8907618366