Conversation

Vlastimil Babka

HOWTO idiot, in 4 easy steps:

1. save the code in [1] as nonexistent.c
2. gcc -O2 -o nonexistent nonexistent.c
3. run and profile the binary
4. wonder why the profiles don't look at all as claimed

[1] https://lore.kernel.org/all/CAHk-%3DwhYOOdM7jWy5jdrAm8LxcgCMFyk2bt8fYYvZzM4U-zAQA@mail.gmail.com/
1
3
10

@vbabka according to the instructions, you should remove compiled binary before launching it

/me runs

1
0
1

@oleksandr Yes, run, run! That's not what the instructions say. They say: “Don't create a file called that for the test.“ Strictly speaking, once @vbabka ran the gcc command, the instructions can no longer be followed.

/me runs

1
0
1

@vbabka @ptesarik It looks like someone didn't get the joke :).

1
0
1

@oleksandr @vbabka No, I've merely seen too much of this world. I can imagine a QA engineer who writes a workaround which removes the binary in the small race window between execve(2) and open(2). The idea is painfully real.

0
1
1