00:08
sscox has quit [Ping timeout: 260 seconds]
00:27
sscox has joined #systemtap
00:59
hpt has joined #systemtap
01:05
hpt has quit [Ping timeout: 250 seconds]
01:06
hpt has joined #systemtap
01:13
hpt has quit [Ping timeout: 265 seconds]
01:15
hpt has joined #systemtap
01:21
hpt has quit [Ping timeout: 265 seconds]
01:23
hpt has joined #systemtap
01:29
hpt has quit [Ping timeout: 264 seconds]
02:26
hpt has joined #systemtap
03:24
<
Amy1 >
how to use condition compile?
03:25
<
Amy1 >
I want to implement something like #if var == 1 code1 #else code2 #endif in C language.
04:31
_whitelogger has joined #systemtap
04:40
_whitelogger has joined #systemtap
06:03
khaled has joined #systemtap
08:58
khaled has quit [Quit: Konversation terminated!]
09:00
khaled has joined #systemtap
09:27
Amy1 has quit [Quit: WeeChat 2.2]
09:54
hpt has quit [Ping timeout: 265 seconds]
10:03
mjw has joined #systemtap
10:26
Amy1 has joined #systemtap
10:26
Amy1 has quit [Client Quit]
10:26
Amy1 has joined #systemtap
12:25
orivej has quit [Ping timeout: 256 seconds]
13:31
sapatel has joined #systemtap
14:40
amerey has joined #systemtap
15:05
tromey has joined #systemtap
15:42
<
Amy1 >
how to make embedded C code to read variables defined in source code ?
15:43
<
fche >
Amy1, not directly from embedded-C
15:43
<
Amy1 >
oh.. I know I can pass from script
15:44
<
fche >
but function foo (value:long) %{ THIS_value; .... %} probe bar { foo($var) }
15:44
<
Amy1 >
yeah, I know thi
15:45
<
Amy1 >
why not develop a function to instrument some code into source code or responding assembly code?
15:46
<
fche >
depends on details
15:46
<
fche >
at run time, we don't have the info re. debuginfo etc. that we do at translate time
15:48
<
Amy1 >
how to source code with embedded-C?
15:48
<
Amy1 >
expand source code with embedded-C
15:49
<
Amy1 >
I want to the complete code with embedded-C
15:49
<
fche >
not sure what you mean 'expand'
15:49
<
Amy1 >
I want to see the complete code with embedded-C. expand like macro expand
15:50
<
fche >
the complete code of what?
15:50
<
fche >
stap -p3 shows all the generated C code from all the stp code, including embedded-C function bodies
15:52
sscox has quit [Ping timeout: 256 seconds]
15:59
<
Amy1 >
ss 2: analyzed script: 2 probes, 8 functions, 2 embeds, 2 globals using 219932virt/22328res/4908shr/17684data kb, in 0usr/10sys/18real ms.
15:59
<
Amy1 >
Pass 2: analysis failed. [man error::pass2]
15:59
<
Amy1 >
Running rm -rf /tmp/stapZ1uzKA
15:59
<
Amy1 >
Spawn waitpid result (0x0): 0
15:59
<
Amy1 >
Removed temporary directory "/tmp/stapZ1uzKA"
16:00
<
Amy1 >
when stap -vvv failed, how to keep /tmp/stapZ1uzKA instead of removing it?
16:02
<
fche >
(keep tmpdir)
16:04
<
Amy1 >
but it's empty
16:04
<
Amy1 >
nothing stored
16:04
<
fche >
during pass 2, no temp files are created yet, it's too early
16:04
<
fche >
-p3 etc., there'd be code there
16:07
<
Amy1 >
Pass 2: analyzed script: 2 probes, 8 functions, 2 embeds, 2 globals using 219932virt/22320res/4908shr/17684data kb, in 0usr/10sys/17real ms.
16:07
<
Amy1 >
Pass 2: analysis failed. [man error::pass2]
16:07
<
Amy1 >
Keeping temporary directory "/tmp/stap9w8BNM"
16:07
<
Amy1 >
My script has an error
16:08
<
fche >
surely there is some error before that point?
16:08
<
Amy1 >
If has an error, break on pass2, then will not generate temporay. Only going to pass 3, can generate temporary.
16:08
<
Amy1 >
I want to see the temporary to debug
16:10
<
Amy1 >
ERROR: probe overhead exceeded threshold
16:10
<
Amy1 >
WARNING: Number of errors: 1, skipped probes: 0
16:10
<
Amy1 >
WARNING: /usr/bin/staprun exited with status: 1
16:11
<
Amy1 >
So what about this bug?
16:11
<
fche >
see man error::pass5
16:13
<
Amy1 >
How to implement something like #if var == 1 code1 #else code2 #endif in C language.
16:15
<
fche >
what var is this?
16:16
<
fche >
in embedded c you can use preprocessor stuff like that
16:16
<
fche >
but 'var' values must be preprocessor macro symbols
16:17
<
Amy1 >
In stp script probe, probe process { %( 1 !=2 %? code1 %?code2 %) }
16:18
<
Amy1 >
I had known this.
16:18
<
Amy1 >
but I don't know how to compare a variable num !=2
16:19
<
fche >
preprocessors must deal with preprocessor-time values, not run-time or context stuff
16:19
<
fche >
what is 'num' ?
16:19
<
Amy1 >
a custom variable
16:19
<
Amy1 >
how to define it
16:19
<
fche >
sorry that doesn't help me, what do you mean by custom variable?
16:19
<
Amy1 >
like #define xx 5
16:19
<
fche >
ok so a c level macro
16:20
<
fche >
so you can put that into an embedded c block
16:20
<
Amy1 >
No, I want to write it in probe
16:21
<
Amy1 >
I want to use xx to control compile which code
16:22
<
Amy1 >
something like C marco, but not C macro used in embedded C code, I want to use in stp probe code.
16:22
<
Amy1 >
%( 1 !=2 %? code1 %?code2 %)
16:22
<
Amy1 >
I can modify 1 to 2 to control compile code2
16:23
<
Amy1 >
I want to replace "1" to a variable, so that I can control much more
16:24
<
Amy1 >
%( num != 67 %? code1 %?code2 %)
16:25
<
Amy1 >
I don't know how to define "num"
16:25
<
fche >
well, how about if() else ?
16:26
<
Amy1 >
if() else running in runtime?
16:26
<
Amy1 >
or compile time?
16:26
<
fche >
run time - if it's a runtime variable, it has to be run then
16:26
<
Amy1 >
Not I want, run time bring too much cost
16:27
<
Amy1 >
why not incroduce #define xxx into stp script
16:27
<
fche >
global xxx = 5
16:27
<
Amy1 >
it is in runtime
16:28
<
fche >
but that's a runtime variable again not a translate-time one
16:28
<
fche >
you could try using the macro facility for this
16:28
<
Amy1 >
how to express?
16:28
<
fche >
@define NAME %( BODY %)
16:28
<
fche >
see [man stap]
16:30
<
Amy1 >
coulde @define xx %( 1 %)
16:30
<
Amy1 >
@define xx %( 1 %)
16:31
<
Amy1 >
%( xx !=2 %?
16:31
<
Amy1 >
that's what I want.
16:33
<
Amy1 >
fche: thank you very much
16:33
<
fche >
glad we figured it out :)\
16:35
<
Amy1 >
semantic error: target-symbol requires debuginfo: identifier '$j' at :33:48
16:35
<
Amy1 >
thrown from: tapsets.cxx:6678
16:35
<
Amy1 >
source: printf(" i %d j %d\n",$i,$j);
16:35
<
Amy1 >
how about this bug?
16:37
<
Amy1 >
when I use -O0 -g, it solved
16:37
<
Amy1 >
but I want to use -O2
16:41
sscox has joined #systemtap
16:43
<
fche >
you'll need to give more complete info about how you're compiling, what the target c program is, and what the stap script is
16:44
<
Amy1 >
wait a minit
16:57
<
Amy1 >
it is source code.
16:57
<
Amy1 >
stap -g print.stp "MD" -c ./MD
16:58
<
Amy1 >
probe process(@1).statement("*@add_pairwise.c:261")
16:58
<
Amy1 >
printf("i %d j %d\n",$i,$j);
16:58
<
Amy1 >
-g -O0 can print i and j
16:58
<
Amy1 >
-g -O2 print an error as:
16:58
<
fche >
hm, j is out of scope by line 261
16:59
<
fche >
or maybe it isn't
16:59
<
Amy1 >
gcc -g -O2 -fopenmp -o MD MD.o control.o util.o add_pairwise.o -lm
16:59
<
Amy1 >
semantic error: no line records for /root/MD/C/add_pairwise.c:261 [man error::dwarf]
16:59
<
Amy1 >
semantic error: while resolving probe point: identifier 'process' at print.stp:4:7
16:59
<
Amy1 >
source: probe process(@1).statement("*@add_pairwise.c:261")
16:59
<
fche >
but yeah compiler optimizers can nuke variables sometimes
16:59
<
Amy1 >
semantic error: no match
16:59
<
Amy1 >
Pass 2: analysis failed. [man error::pass2]
16:59
<
fche >
stap -L 'process("MD").statement("*@add_pairwise.c:*")'
17:00
<
fche >
stap -L 'process("MD").statement("*@*:*")' why not
17:00
<
fche >
you will need -g in CFLAGS
17:01
<
Amy1 >
but I think i and j should not be optimized, beause they are loop iterator, right?
17:02
<
Amy1 >
if -g -O2 print the error, it seems stap's use was limited
17:14
<
Amy1 >
ERROR: probe overhead exceeded threshold
17:14
<
Amy1 >
WARNING: Number of errors: 1, skipped probes: 0
17:14
<
Amy1 >
WARNING: /usr/bin/staprun exited with status: 1
17:15
<
Amy1 >
fche: so back again, does this mean that probe code cost is too high?
17:24
<
fche >
so see man error::pass5 for stap options that can suppress these various safety checks
17:29
sapatel has quit [Remote host closed the connection]
17:30
<
Amy1 >
why introducing this forbid?
17:31
<
Amy1 >
which situation need this check?
17:31
<
fche >
it protects a system from accidentally overzealous probing that could bog the system down
17:33
sapatel has joined #systemtap
17:34
<
Amy1 >
I want to follow the development
17:34
<
Amy1 >
So how do I learn quickly to join it?
17:35
<
Amy1 >
Is there good materials?
17:35
<
Amy1 >
about source code study
17:39
sscox has quit [Ping timeout: 260 seconds]
17:50
sscox has joined #systemtap
19:19
sscox has quit [Ping timeout: 260 seconds]
19:32
orivej has joined #systemtap
19:38
sscox has joined #systemtap
19:46
mjw has quit [Quit: Leaving]
20:17
irker150 has joined #systemtap
20:17
<
irker150 >
systemtap: fche systemtap.git:master * release-4.2-56-g26a7caa17 / elaborate.cxx session.cxx: RHBZ1795159: unbreak java.exp test cases
20:17
<
irker150 >
systemtap: fche systemtap.git:master * release-4.2-55-g2f35e5431 / testsuite/systemtap.base/listing_mode_sanity.exp: testsuite: listing_mode_sanity.exp: update for new vfs_read() signature
20:45
sapatel has quit [Remote host closed the connection]
20:53
sapatel has joined #systemtap
21:06
tromey has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
22:33
amerey has quit [Quit: Leaving]
23:17
irker150 has quit [Quit: transmission timeout]
23:40
sapatel has quit [Remote host closed the connection]