Skip to content

Commit 033929a

Browse files
authored
Merge pull request #3607 from masatake/systemtap--probe-attached
Systemtap: add new role "attached" for "probe" kind , and run CPreProcessor as a guest parser
2 parents fe02d29 + d56036c commit 033929a

35 files changed

+479
-90
lines changed

Tmain/list-roles.d/stdout-expected.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Ruby L/library required on loaded by "require"
9494
Ruby L/library requiredRel on loaded by "require_relative" method
9595
Sh h/heredoc endmarker on end marker
9696
Sh s/script loaded on loaded
97+
SystemTap p/probe attached on attached by code for probing
9798
SystemVerilog m/module decl on declaring instances
9899
SystemdUnit u/unit After on referred in After key
99100
SystemdUnit u/unit Before on referred in Before key
@@ -212,6 +213,7 @@ Ruby L/library required on loaded by "require"
212213
Ruby L/library requiredRel on loaded by "require_relative" method
213214
Sh h/heredoc endmarker on end marker
214215
Sh s/script loaded on loaded
216+
SystemTap p/probe attached on attached by code for probing
215217
SystemVerilog m/module decl on declaring instances
216218
SystemdUnit u/unit After on referred in After key
217219
SystemdUnit u/unit Before on referred in Before key

Tmain/optscript.d/error-undefined-if-if.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ top| |bottom
44
Execution stack:
55
top| a {a} --if-- {true {a} if} --if-- |bottom
66
Dictionary stack:
7-
top| -dict:1- -dict:88- |bottom
7+
top| -dict:1- -dict:89- |bottom

Tmain/optscript.d/error-undefined-if.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ top| |bottom
44
Execution stack:
55
top| a {a} --if-- |bottom
66
Dictionary stack:
7-
top| -dict:1- -dict:88- |bottom
7+
top| -dict:1- -dict:89- |bottom

Tmain/optscript.d/typeattrconv.expected

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,10 @@ arraytype
3131
(--arraytype--)
3232
(--dicttype--)
3333
(--arraytype--)
34+
3
35+
abc
36+
/abc
37+
true
38+
{}
39+
[]
40+
true

Tmain/optscript.d/typeattrconv.ps

109 Bytes
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
--sort=no
2-
--fields=+ne
2+
--fields=+ner
3+
--extras=+r
4+
--extras=+g
Lines changed: 72 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,72 @@
1-
tcp_get_info_rto input.stp /^function tcp_get_info_rto:long(sock:long)$/;" f line:33 end:44
2-
tcp_get_info_snd_cwnd input.stp /^function tcp_get_info_snd_cwnd:long(sock:long)$/;" f line:50 end:60
3-
tcp_ts_get_info_state input.stp /^function tcp_ts_get_info_state:long(sock:long)$/;" f line:78 end:83
4-
__tcp_sock_dport input.stp /^function __tcp_sock_dport:long (sock:long)$/;" f line:86 end:93
5-
__get_skb_tcphdr_new input.stp /^@__private30 function __get_skb_tcphdr_new:long(skb:long)$/;" f line:96 end:107
6-
__get_skb_tcphdr input.stp /^function __get_skb_tcphdr:long(skb:long)$/;" f line:110 end:118
7-
__tcp_skb_urg input.stp /^function __tcp_skb_urg:long (tcphdr:long)$/;" f line:121 end:124
8-
__tcp_skb_ack input.stp /^function __tcp_skb_ack:long (tcphdr:long)$/;" f line:127 end:130
9-
__tcp_skb_psh input.stp /^function __tcp_skb_psh:long (tcphdr:long)$/;" f line:133 end:136
10-
__tcp_skb_rst input.stp /^function __tcp_skb_rst:long (tcphdr:long)$/;" f line:139 end:142
11-
__tcp_skb_syn input.stp /^function __tcp_skb_syn:long (tcphdr:long)$/;" f line:145 end:148
12-
__tcp_skb_fin input.stp /^function __tcp_skb_fin:long (tcphdr:long)$/;" f line:151 end:154
13-
__tcp_skb_sport input.stp /^function __tcp_skb_sport:long (tcphdr:long)$/;" f line:157 end:160
14-
__tcp_skb_dport input.stp /^function __tcp_skb_dport:long (tcphdr:long){$/;" f line:163 end:165
15-
__tcp_sock_sport input.stp /^function __tcp_sock_sport:long (sock:long)$/;" f line:168 end:174
16-
sockstate input.stp /^@__private30 global sockstate[12]$/;" v line:176
17-
tcp_sockstate_str input.stp /^function tcp_sockstate_str:string (state:long) {$/;" f line:192 end:194
18-
tcp_ts_get_info_snd_ssthresh input.stp /^function tcp_ts_get_info_snd_ssthresh:long(sock:long)$/;" f line:199 end:209
19-
tcp_ts_get_info_rcv_mss input.stp /^function tcp_ts_get_info_rcv_mss:long(sock:long)$/;" f line:213 end:224
20-
__sockopt input.stp /^@__private30 global __sockopt[18]$/;" v line:248
21-
tcp_sockopt_str input.stp /^function tcp_sockopt_str:string (optname:long)$/;" f line:281 end:285
22-
__ipv6_sockopt input.stp /^@__private30 global __ipv6_sockopt[55]$/;" v line:349
23-
tcp_ipv6_sockopt_str input.stp /^function tcp_ipv6_sockopt_str:string (optname:long)$/;" f line:467 end:471
24-
tcp.sendmsg input.stp /^probe tcp.sendmsg = kernel.function("tcp_sendmsg") {$/;" p line:483 end:488
25-
tcp.sendmsg.return input.stp /^probe tcp.sendmsg.return = kernel.function("tcp_sendmsg").return {$/;" p line:498 end:501
26-
tcp.recvmsg input.stp /^probe tcp.recvmsg = kernel.function("tcp_recvmsg") {$/;" p line:516 end:525
27-
tcp.recvmsg.return input.stp /^probe tcp.recvmsg.return = kernel.function("tcp_recvmsg").return {$/;" p line:540 end:548
28-
tcp.disconnect input.stp /^probe tcp.disconnect = kernel.function("tcp_disconnect") {$/;" p line:564 end:573
29-
tcp.disconnect.return input.stp /^probe tcp.disconnect.return = kernel.function("tcp_disconnect").return {$/;" p line:583 end:586
30-
tcp.setsockopt input.stp /^probe tcp.setsockopt = tcp.ipv4.setsockopt, tcp.ipv6.setsockopt$/;" p line:601 end:603
31-
tcp.ipv4.setsockopt input.stp /^probe tcp.ipv4.setsockopt = kernel.function("tcp_setsockopt")$/;" p line:604 end:613
32-
tcp.ipv6.setsockopt input.stp /^probe tcp.ipv6.setsockopt = kernel.function("ipv6_setsockopt")!,$/;" p line:614 end:624
33-
tcp.setsockopt.return input.stp /^probe tcp.setsockopt.return = tcp.ipv4.setsockopt.return,$/;" p line:634 end:637
34-
tcp.ipv4.setsockopt.return input.stp /^probe tcp.ipv4.setsockopt.return = kernel.function("tcp_setsockopt").return$/;" p line:638 end:642
35-
tcp.ipv6.setsockopt.return input.stp /^probe tcp.ipv6.setsockopt.return = kernel.function("ipv6_setsockopt").return!,$/;" p line:643 end:648
36-
tcp.receive input.stp /^probe tcp.receive = tcp.ipv4.receive, tcp.ipv6.receive$/;" p line:667 end:669
37-
tcp.ipv4.receive input.stp /^probe tcp.ipv4.receive = kernel.function("tcp_v4_rcv")$/;" p line:671 end:694
38-
tcp.ipv6.receive input.stp /^probe tcp.ipv6.receive = kernel.function("tcp_v6_rcv")!,$/;" p line:696 end:730
1+
tcp_get_info_rto input.stp /^function tcp_get_info_rto:long(sock:long)$/;" f line:33 roles:def end:44
2+
tcp_get_info_snd_cwnd input.stp /^function tcp_get_info_snd_cwnd:long(sock:long)$/;" f line:50 roles:def end:60
3+
tcp_ts_get_info_state input.stp /^function tcp_ts_get_info_state:long(sock:long)$/;" f line:78 roles:def end:83
4+
__tcp_sock_dport input.stp /^function __tcp_sock_dport:long (sock:long)$/;" f line:86 roles:def end:93
5+
__get_skb_tcphdr_new input.stp /^@__private30 function __get_skb_tcphdr_new:long(skb:long)$/;" f line:96 roles:def end:107
6+
__get_skb_tcphdr input.stp /^function __get_skb_tcphdr:long(skb:long)$/;" f line:110 roles:def end:118
7+
__tcp_skb_urg input.stp /^function __tcp_skb_urg:long (tcphdr:long)$/;" f line:121 roles:def end:124
8+
__tcp_skb_ack input.stp /^function __tcp_skb_ack:long (tcphdr:long)$/;" f line:127 roles:def end:130
9+
__tcp_skb_psh input.stp /^function __tcp_skb_psh:long (tcphdr:long)$/;" f line:133 roles:def end:136
10+
__tcp_skb_rst input.stp /^function __tcp_skb_rst:long (tcphdr:long)$/;" f line:139 roles:def end:142
11+
__tcp_skb_syn input.stp /^function __tcp_skb_syn:long (tcphdr:long)$/;" f line:145 roles:def end:148
12+
__tcp_skb_fin input.stp /^function __tcp_skb_fin:long (tcphdr:long)$/;" f line:151 roles:def end:154
13+
__tcp_skb_sport input.stp /^function __tcp_skb_sport:long (tcphdr:long)$/;" f line:157 roles:def end:160
14+
__tcp_skb_dport input.stp /^function __tcp_skb_dport:long (tcphdr:long){$/;" f line:163 roles:def end:165
15+
__tcp_sock_sport input.stp /^function __tcp_sock_sport:long (sock:long)$/;" f line:168 roles:def end:174
16+
sockstate input.stp /^@__private30 global sockstate[12]$/;" v line:176 roles:def
17+
init input.stp /^probe init {$/;" p line:177 roles:attached end:190
18+
tcp_sockstate_str input.stp /^function tcp_sockstate_str:string (state:long) {$/;" f line:192 roles:def end:194
19+
tcp_ts_get_info_snd_ssthresh input.stp /^function tcp_ts_get_info_snd_ssthresh:long(sock:long)$/;" f line:199 roles:def end:209
20+
tcp_ts_get_info_rcv_mss input.stp /^function tcp_ts_get_info_rcv_mss:long(sock:long)$/;" f line:213 roles:def end:224
21+
__sockopt input.stp /^@__private30 global __sockopt[18]$/;" v line:248 roles:def
22+
init input.stp /^probe init {$/;" p line:249 roles:attached end:279
23+
tcp_sockopt_str input.stp /^function tcp_sockopt_str:string (optname:long)$/;" f line:281 roles:def end:285
24+
__ipv6_sockopt input.stp /^@__private30 global __ipv6_sockopt[55]$/;" v line:349 roles:def
25+
init input.stp /^probe init {$/;" p line:350 roles:attached end:465
26+
tcp_ipv6_sockopt_str input.stp /^function tcp_ipv6_sockopt_str:string (optname:long)$/;" f line:467 roles:def end:471
27+
tcp.sendmsg input.stp /^probe tcp.sendmsg = kernel.function("tcp_sendmsg") {$/;" p line:483 roles:def end:488
28+
tcp.sendmsg.return input.stp /^probe tcp.sendmsg.return = kernel.function("tcp_sendmsg").return {$/;" p line:498 roles:def end:501
29+
tcp.recvmsg input.stp /^probe tcp.recvmsg = kernel.function("tcp_recvmsg") {$/;" p line:516 roles:def end:525
30+
tcp.recvmsg.return input.stp /^probe tcp.recvmsg.return = kernel.function("tcp_recvmsg").return {$/;" p line:540 roles:def end:548
31+
tcp.disconnect input.stp /^probe tcp.disconnect = kernel.function("tcp_disconnect") {$/;" p line:564 roles:def end:573
32+
tcp.disconnect.return input.stp /^probe tcp.disconnect.return = kernel.function("tcp_disconnect").return {$/;" p line:583 roles:def end:586
33+
tcp.setsockopt input.stp /^probe tcp.setsockopt = tcp.ipv4.setsockopt, tcp.ipv6.setsockopt$/;" p line:601 roles:def end:603
34+
tcp.ipv4.setsockopt input.stp /^probe tcp.ipv4.setsockopt = kernel.function("tcp_setsockopt")$/;" p line:604 roles:def end:613
35+
tcp.ipv6.setsockopt input.stp /^probe tcp.ipv6.setsockopt = kernel.function("ipv6_setsockopt")!,$/;" p line:614 roles:def end:624
36+
tcp.setsockopt.return input.stp /^probe tcp.setsockopt.return = tcp.ipv4.setsockopt.return,$/;" p line:634 roles:def end:637
37+
tcp.ipv4.setsockopt.return input.stp /^probe tcp.ipv4.setsockopt.return = kernel.function("tcp_setsockopt").return$/;" p line:638 roles:def end:642
38+
tcp.ipv6.setsockopt.return input.stp /^probe tcp.ipv6.setsockopt.return = kernel.function("ipv6_setsockopt").return!,$/;" p line:643 roles:def end:648
39+
tcp.receive input.stp /^probe tcp.receive = tcp.ipv4.receive, tcp.ipv6.receive$/;" p line:667 roles:def end:669
40+
tcp.ipv4.receive input.stp /^probe tcp.ipv4.receive = kernel.function("tcp_v4_rcv")$/;" p line:671 roles:def end:694
41+
tcp.ipv6.receive input.stp /^probe tcp.ipv6.receive = kernel.function("tcp_v6_rcv")!,$/;" p line:696 roles:def end:730
42+
linux/version.h input.stp /^#include <linux\/version.h>/;" h line:22 roles:system
43+
net/sock.h input.stp /^#include <net\/sock.h>/;" h line:23 roles:system
44+
net/tcp.h input.stp /^#include <net\/tcp.h>/;" h line:24 roles:system
45+
net/ip.h input.stp /^#include <net\/ip.h>/;" h line:25 roles:system
46+
linux/skbuff.h input.stp /^#include <linux\/skbuff.h>/;" h line:26 roles:system
47+
TCP_CONGESTION input.stp /^#define TCP_CONGESTION /;" d line:229 file: roles:def end:229
48+
TCP_MD5SIG input.stp /^#define TCP_MD5SIG /;" d line:232 file: roles:def end:232
49+
TCP_COOKIE_TRANSACTIONS input.stp /^#define TCP_COOKIE_TRANSACTIONS /;" d line:235 file: roles:def end:235
50+
TCP_THIN_LINEAR_TIMEOUTS input.stp /^#define TCP_THIN_LINEAR_TIMEOUTS /;" d line:238 file: roles:def end:238
51+
TCP_THIN_DUPACK input.stp /^#define TCP_THIN_DUPACK /;" d line:241 file: roles:def end:241
52+
TCP_USER_TIMEOUT input.stp /^#define TCP_USER_TIMEOUT /;" d line:244 file: roles:def end:244
53+
linux/in6.h input.stp /^#include <linux\/in6.h>/;" h line:289 roles:system
54+
IPV6_2292PKTINFO input.stp /^#define IPV6_2292PKTINFO /;" d line:291 file: roles:def end:291
55+
IPV6_2292HOPOPTS input.stp /^#define IPV6_2292HOPOPTS /;" d line:294 file: roles:def end:294
56+
IPV6_2292DSTOPTS input.stp /^#define IPV6_2292DSTOPTS /;" d line:297 file: roles:def end:297
57+
IPV6_2292RTHDR input.stp /^#define IPV6_2292RTHDR /;" d line:300 file: roles:def end:300
58+
IPV6_2292PKTOPTIONS input.stp /^#define IPV6_2292PKTOPTIONS /;" d line:303 file: roles:def end:303
59+
IPV6_2292HOPLIMIT input.stp /^#define IPV6_2292HOPLIMIT /;" d line:306 file: roles:def end:306
60+
IPV6_RECVPKTINFO input.stp /^#define IPV6_RECVPKTINFO /;" d line:309 file: roles:def end:309
61+
IPV6_RECVHOPLIMIT input.stp /^#define IPV6_RECVHOPLIMIT /;" d line:312 file: roles:def end:312
62+
IPV6_RECVHOPOPTS input.stp /^#define IPV6_RECVHOPOPTS /;" d line:315 file: roles:def end:315
63+
IPV6_RTHDRDSTOPTS input.stp /^#define IPV6_RTHDRDSTOPTS /;" d line:318 file: roles:def end:318
64+
IPV6_RECVRTHDR input.stp /^#define IPV6_RECVRTHDR /;" d line:321 file: roles:def end:321
65+
IPV6_RECVDSTOPTS input.stp /^#define IPV6_RECVDSTOPTS /;" d line:324 file: roles:def end:324
66+
IPV6_RECVPATHMTU input.stp /^#define IPV6_RECVPATHMTU /;" d line:327 file: roles:def end:327
67+
IPV6_PATHMTU input.stp /^#define IPV6_PATHMTU /;" d line:330 file: roles:def end:330
68+
IPV6_DONTFRAG input.stp /^#define IPV6_DONTFRAG /;" d line:333 file: roles:def end:333
69+
IPV6_ADDR_PREFERENCES input.stp /^#define IPV6_ADDR_PREFERENCES /;" d line:336 file: roles:def end:336
70+
IPV6_MINHOPCOUNT input.stp /^#define IPV6_MINHOPCOUNT /;" d line:339 file: roles:def end:339
71+
IPV6_RECVORIGDSTADDR input.stp /^#define IPV6_RECVORIGDSTADDR /;" d line:342 file: roles:def end:342
72+
IPV6_TRANSPARENT input.stp /^#define IPV6_TRANSPARENT /;" d line:345 file: roles:def end:345

docs/contributions.rst

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,21 +429,36 @@ Title of commit log and pull request
429429

430430
* Use following prefixes for the changes other than parsers.
431431

432-
main:
432+
main
433433
Changes for files under ``main/`` directory
434434

435-
Units:
435+
Units
436436
Changes for the test cases under ``Units/`` directory
437437

438438
Tmain
439439
Changes for the test cases under ``Tmain/`` directory
440440

441+
units
442+
Changes for the test harness (misc/units.py) itself
443+
441444
docs(web)
442445
Changes for the ``docs/*.rst``
443446

444447
docs(man)
445448
Changes for the ``man/*.rst``
446449

450+
dsl
451+
Changes operators that can be used in optscript command
452+
453+
operators
454+
Changes operators that can be used in optlib `{{` ... `}}` blocks
455+
456+
prelude
457+
Changes optlib procedures defined in main/CommonPrelude.ps
458+
459+
CXX (or Cxx)
460+
Changes affecting all parsers defined in parsers/cxx
461+
447462
See also the output of ``git log`` command.
448463

449464
* Combine prefixes with a comma if a change modifies multiple parts of our source tree

docs/man-pages.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Man pages
2727
ctags-lang-r(7) <man/ctags-lang-r.7.rst>
2828
ctags-lang-rmarkdown(7) <man/ctags-lang-rmarkdown.7.rst>
2929
ctags-lang-sql(7) <man/ctags-lang-sql.7.rst>
30+
ctags-lang-systemtap(7) <man/ctags-lang-systemtap.7.rst>
3031
ctags-lang-tcl(7) <man/ctags-lang-tcl.7.rst>
3132
ctags-lang-verilog(7) <man/ctags-lang-verilog.7.rst>
3233

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.. _ctags-lang-systemtap(7):
2+
3+
==============================================================
4+
ctags-lang-systemtap
5+
==============================================================
6+
7+
Random notes about tagging SystepTap source code with Universal Ctags
8+
9+
:Version: 6.0.0
10+
:Manual group: Universal Ctags
11+
:Manual section: 7
12+
13+
SYNOPSIS
14+
--------
15+
| **ctags** ... --languages=+SystemTap ...
16+
| **ctags** ... --language-force=SystemTap ...
17+
| **ctags** ... --map-SystemTap=+.stp ...
18+
19+
DESCRIPTION
20+
-----------
21+
This man page gathers random notes about tagging SystemTap scripts.
22+
23+
Guests
24+
~~~~~~~~~~~
25+
The SystemTap parser runs CPreProcessor as a guest parser on the areas
26+
surrounded by `%{` and `%}`.
27+
28+
"input.stp"
29+
30+
.. code-block:: SystemTap
31+
32+
%{
33+
#define X 1
34+
%}
35+
36+
"output.tags"
37+
with "--options=NONE -o - --sort=no --extras=+{guest} input.stp"
38+
39+
.. code-block:: tags
40+
41+
X input.stp /^#define X /;" d file:
42+
43+
VERSIONS
44+
--------
45+
46+
Change since "0.0"
47+
~~~~~~~~~~~~~~~~~~
48+
49+
* New role ``attached`` for ``probe`` kind
50+
51+
SEE ALSO
52+
--------
53+
:ref:`ctags(1) <ctags(1)>`, `SystemTap Language Reference <https://sourceware.org/systemtap/langref>`_ (https://sourceware.org/systemtap/langref/)

0 commit comments

Comments
 (0)