Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
531f817c
Commit
531f817c
authored
Feb 18, 2018
by
yonghong-song
Committed by
GitHub
Feb 18, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1596 from pchaigno/check-helpers-no-disk
scripts: avoid check-helpers.sh's writes to disk
parents
6c81f9d6
c5f48e0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
scripts/check-helpers.sh
scripts/check-helpers.sh
+7
-7
No files found.
scripts/check-helpers.sh
View file @
531f817c
#!/bin/bash
ret
=
0
grep
-oP
'(?<={")\w+(?=", "\d\.\d+")'
src/cc/libbpf.c |
sort
>
/tmp/libbpf.txt
grep
-oP
"(?<=BPF_FUNC_)
\w
+"
docs/kernel-versions.md |
sort
>
/tmp/doc.txt
dif
=
`
diff /tmp/libbpf.txt /tmp/doc.txt
`
libbpf
=
$(
grep
-oP
'(?<={")\w+(?=", "\d\.\d+")'
src/cc/libbpf.c |
sort
)
doc
=
$(
grep
-oP
"(?<=BPF_FUNC_)
\w
+"
docs/kernel-versions.md |
sort
)
dif
=
$(
diff <
(
echo
"
$doc
"
)
<
(
echo
"
$libbpf
"
)
)
if
[
$?
-ne
0
]
;
then
echo
"The lists of helpers in src/cc/libbpf.c and docs/kernel-versions.md differ:"
echo
-e
"
$dif
\n
"
((
ret++
))
fi
grep
-oP
"(?<=^
\s
FN
\(
)
\w
+"
src/cc/compat/linux/bpf.h |
tail
-n
+2 |
sort
>
/tmp/compat.txt
dif
=
`
diff /tmp/doc.txt /tmp/compat.txt
`
compat
=
$(
grep
-oP
"(?<=^
\s
FN
\(
)
\w
+"
src/cc/compat/linux/bpf.h |
tail
-n
+2 |
sort
)
dif
=
$(
diff <
(
echo
"
$doc
"
)
<
(
echo
"
$compat
"
)
)
if
[
$?
-ne
0
]
;
then
echo
"The lists of helpers in docs/kernel-versions.md and src/cc/compat/linux/bpf.h differ:"
echo
-e
"
$dif
\n
"
((
ret++
))
fi
grep
-oP
"(?<=BPF_FUNC_)
\w
+"
src/cc/export/helpers.h |
sort
-u
>
/tmp/export.txt
dif
=
`
diff /tmp/compat.txt /tmp/export.txt
`
export
=
$(
grep
-oP
"(?<=BPF_FUNC_)
\w
+"
src/cc/export/helpers.h |
sort
-u
)
dif
=
$(
diff <
(
echo
"
$compat
"
)
<
(
echo
"
$export
"
)
)
if
[
$?
-ne
0
]
;
then
echo
"The lists of helpers in src/cc/compat/linux/bpf.h and src/cc/export/helpers.h differ:"
echo
"
$dif
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment