Skip to content

Instantly share code, notes, and snippets.

@danobi
danobi / gist:38197d1842a749a471754953c15f6351
Created March 18, 2025 18:52
clang-tidy readability codemod
dxu@kashmir~/d/bpftrace (tidy_readability) $ ./scripts/clang_tidy.sh -u
-- Found LLVM 20.1.0-rc2: /nix/store/8q54m0ay575zyjfm5pany4zfnlmjjnhk-llvm-20.1.0-rc2-dev/lib/cmake/llvm
-- Please install the lldb development package (missing: LLDB_LIBRARIES LLDB_INCLUDE_DIRS)
-- Using SYSTEM_INCLUDE_PATHS=auto
-- Disabled codegen tests. Requires GNU/GCC and LLVM 18 (found GNU, LLVM 20)
-- Not building with LLVM 18, skipping codegen-validator test
-- Configuring done (0.5s)
-- Generating done (0.2s)
-- Build files have been written to: /home/dxu/dev/bpftrace/build-clang-tidy
make: Entering directory '/home/dxu/dev/bpftrace/build-clang-tidy'
$ codeql query run --database ~/scratch/codeql/bpftrace-db queries/UnserializedMember.ql
[...]
| member | col1 | col2 |
+-------------------+------------------------------------------------------+----------------------+
| cgroup_path_args | Member is not being serialized in a serialized class | required_resources.h |
| skboutput_args_ | Member is not being serialized in a serialized class | required_resources.h |
| helper_error_info | Member is not being serialized in a serialized class | required_resources.h |
| str_buffers | Member is not being serialized in a serialized class | required_resources.h |
| watchpoint_probes | Member is not being serialized in a serialized class | required_resources.h |
| probes_using_usym | Member is not being serialized in a serialized class | required_resources.h |
import cpp
from MemberVariable member
where
member.getNamespace().getName() = "bpftrace" and
member.getDeclaringType().getAMemberFunction().getName() = "serialize" and
not exists(VariableAccess va | va.getEnclosingFunction().getName() = "serialize" | va.getTarget() = member)
select
member,
"Member is not being serialized in a serialized class",
@danobi
danobi / gist:4d5e0101ffe73f7b6d37b7291ab95a13
Created April 11, 2020 20:34
org.iovisor.Bpftrace.json
{
"app-id": "org.iovisor.Bpftrace",
"runtime": "org.freedesktop.Platform",
"runtime-version": "19.08",
"sdk": "org.freedesktop.Sdk",
"command": "bpftrace",
"finish-args": [
"--filesystem=host",
"--filesystem=/lib",
"--filesystem=/lib32",

Keybase proof

I hereby claim:

  • I am danobi on github.
  • I am dxu (https://keybase.io/dxu) on keybase.
  • I have a public key whose fingerprint is E273 5EC6 F99D 3640 EC70 B5E5 446E 4D9C 8BB1 77FD

To claim this, I am signing this object:

" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)