tools/bpf/bpftool/token.c
Source file repositories/reference/linux-study-clean/tools/bpf/bpftool/token.c
File Facts
- System
- Linux kernel
- Corpus path
tools/bpf/bpftool/token.c- Extension
.c- Size
- 3970 bytes
- Lines
- 211
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
errno.hfcntl.hstdbool.hstdio.hstdlib.hstring.hunistd.hmntent.hsys/types.hsys/stat.hjson_writer.hmain.h
Detected Declarations
function has_delegate_optionsfunction print_items_per_linefunction show_token_info_plainfunction split_json_array_strfunction show_token_info_jsonfunction __show_token_infofunction show_token_infofunction do_showfunction do_helpfunction do_token
Annotated Snippet
if (strncmp(ent->mnt_type, "bpf", 3) == 0) {
if (has_delegate_options(ent->mnt_opts))
__show_token_info(ent);
}
}
if (json_output)
jsonw_end_array(json_wtr);
endmntent(fp);
return 0;
}
static int do_show(int argc, char **argv)
{
if (argc)
return BAD_ARG();
return show_token_info();
}
static int do_help(int argc, char **argv)
{
if (json_output) {
jsonw_null(json_wtr);
return 0;
}
fprintf(stderr,
"Usage: %1$s %2$s { show | list }\n"
" %1$s %2$s help\n"
" " HELP_SPEC_OPTIONS " }\n"
"\n"
"",
bin_name, argv[-2]);
return 0;
}
static const struct cmd cmds[] = {
{ "show", do_show },
{ "list", do_show },
{ "help", do_help },
{ 0 }
};
int do_token(int argc, char **argv)
{
return cmd_select(cmds, argc, argv, do_help);
}
Annotation
- Immediate include surface: `errno.h`, `fcntl.h`, `stdbool.h`, `stdio.h`, `stdlib.h`, `string.h`, `unistd.h`, `mntent.h`.
- Detected declarations: `function has_delegate_options`, `function print_items_per_line`, `function show_token_info_plain`, `function split_json_array_str`, `function show_token_info_json`, `function __show_token_info`, `function show_token_info`, `function do_show`, `function do_help`, `function do_token`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.