File: bpftrace.vim

package info (click to toggle)
vim 2%3A9.1.2103-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 93,456 kB
  • sloc: ansic: 433,730; cpp: 6,399; makefile: 4,597; sh: 2,397; java: 2,312; xml: 2,099; python: 1,595; perl: 1,419; awk: 730; lisp: 501; cs: 458; objc: 369; sed: 8; csh: 6; haskell: 1
file content (66 lines) | stat: -rw-r--r-- 2,239 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
" Vim syntax file
" Language:		bpftrace
" Maintainer:		Stanislaw Gruszka <stf_xl@wp.pl>
" Last Change:		2025 Dec 22

" Quit when a syntax file was already loaded
if exists("b:current_syntax")
  finish
endif

let s:cpo_save = &cpo
set cpo&vim

syn keyword	bpftraceConditional	if else
syn keyword	bpftraceRepeat		while for unroll
syn keyword	bpftraceStatement	break continue return
syn keyword	bpftraceKeyword		let macro import config
syn keyword	bpftraceOperator	sizeof offsetof

syn keyword	bpftraceProbe		BEGIN END begin end
syn match	bpftraceProbe		"\v<(bench|self|test)\ze:"
syn match	bpftraceProbe		"\v<(fentry|fexit|kfunc|kretfunc|kprobe|kretprobe)\ze:"
syn match	bpftraceProbe		"\v<(profile|interval|iterator|hardware|software|uprobe|uretprobe)\ze:"
syn match	bpftraceProbe		"\v<(usdt|tracepoint|rawtracepoint|watchpoint|asyncwatchpoint)\ze:"
syn match	bpftraceProbe		"\v(^|[^:])<\zs(h|i|it|f|fr|k|kr|p|rt|s|t|u|ur|U|w|aw)\ze:"

syn keyword	bpftraceType		bool int8 int16 int32 int64
syn keyword	bpftraceType		uint8 uint16 uint32 uint64
syn keyword	bpftraceType		struct

syn match	bpftraceMacro		"\<\h\w*\ze\_s*("

syn match	bpftraceNumber		display	"[+-]\=\<\d\+\>"
syn match	bpftraceNumber		display	"\<0x\x\+\>"

syn keyword	bpftraceBoolean		true false

syn region	bpftraceString		start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell extend

syn keyword	bpftraceTodo		contained TODO FIXME XXX
syn match	bpftraceShebang		/\%^#![^[].*/
syn region	bpftraceCommentLine	start="//" end="$" contains=bpftraceTodo,@Spell
syn region	bpftraceCommentBlock	matchgroup=bpftraceCommentBlock start="/\*" end="\*/" contains=bpftraceTodo,@Spell

" Define the default highlighting.
hi def link	bpftraceConditional	Conditional
hi def link	bpftraceMacro		Macro
hi def link	bpftraceRepeat		Repeat
hi def link	bpftraceKeyword		Keyword
hi def link	bpftraceNumber		Number
hi def link	bpftraceBoolean		Boolean
hi def link	bpftraceShebang		Comment
hi def link	bpftraceCommentLine	Comment
hi def link	bpftraceCommentBlock	Comment
hi def link	bpftraceString		String
hi def link	bpftraceType		Type
hi def link	bpftraceProbe		Identifier

syn sync minlines=100

let b:current_syntax = "bpftrace"

let &cpo = s:cpo_save
unlet s:cpo_save

" vim: ts=8 sw=8 noexpandtab