DOKK / manpages / debian 12 / sparse / semind.1.en
semind(1) General Commands Manual semind(1)

semind - Semantic Indexer for C

semind [options]
semind [options] add [command options] [--] [compiler options] [files...]
semind [options] rm [command options] pattern
semind [options] search [command options] [pattern]
semind [options] search [command options] (-e|-l) filename:linenr:column

semind is the simple to use cscope-like tool based on sparse/dissect. Unlike cscope it runs after pre-processor and thus it can't index the code filtered out by ifdef's, but otoh it understands how the symbol is used and it can track the usage of struct members.

generates or updates semantic index file.
removes files from the index by pattern. The pattern is a glob(7) wildcard pattern.
queries information about symbol by pattern. The pattern is a glob(7) wildcard pattern.

specify database file (default: ./semind.sqlite).
show information about what is being done.
show this text and exit.

include into the index local symbols.

specify an output format. Default: '(%m) %f\t%l\t%c\t%C\t%s' (see FORMAT below).
search symbols only in specified directories.
search only the specified type of access (see MODE below).
specify a kind of symbol (see KIND below).
Show what happens in the specified file position;
Show usage of symbols from a specific file position;
show information about what is being done;
show this text and exit.

%m
access mode in human readable form (see MODE below).
%f
file name.
%l
line number.
%c
column number.
%C
the name of the function in which the symbol occurs.
%n
symbol name.
%s
source code line. Indexer does not save source code lines. They are read from the file during the search.

function
strict
struct member

The MODE is dumped as a 3-letter string. The first letter denotes address of part, 2-nd - access by value, 3-rd - access by pointer. A special value 'def' means a symbol definition.

read
write
read and write

sparse(1)

https://sparse.docs.kernel.org

linux-sparse@vger.kernel.org