Skip to content

make it possible to _not_ separate by thread #24

@weissi

Description

@weissi

In most cases, I like that Swift Profile Recorder separates everything by thread. But for some tooling this isn't helpful.

For example, when running the demo

swipr-mini-demo --tsp true --threads 10 --output /tmp/raw.swipr

and then making a FlameGraph from that

.build/release/swipr-sample-conv /tmp/raw.swipr | ~/extsrc/FlameGraph/stackcollapse-perf.pl | swift demangle --simplified | ~/extsrc/FlameGraph/flamegraph.pl > /tmp/out.svg && open -a Safari /tmp/out.svg

you get

Image

which doesn't look very pretty...

On the other hand, if we add a sed -r 's/^[^ ]+-T[0-9]+/everything/g' to make all the threads appear in just one thread called "everything"

.build/release/swipr-sample-conv /tmp/raw.swipr | sed -r 's/^[^ ]*-T[0-9]+/everything/g' | ~/extsrc/FlameGraph/stackcollapse-perf.pl | swift demangle --simplified | ~/extsrc/FlameGraph/flamegraph.pl > /tmp/out.svg && open -a Safari /tmp/out.svg

the result is much prettier

Image

But instead of forcing our users to come up with a pretty difficult sed command, we could just offer curl -sd {"treadNames": false, ...} or similar

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementImprovements to existing feature.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions