Commit graph

49 commits

Author SHA1 Message Date
Franciszek Stachura
910bdd7938 Add query class, env arg to script and scriptLines 2024-01-10 14:52:28 +01:00
Ziyue Pan
7c4886cf3c Style: fix redundant parentheses and typos
(cherry picked from commit cd89684ce633c4997b328395cc882de3ab655475)
2023-03-23 09:54:14 +01:00
Michael Opdenacker
0a46686643 Remove 'page' identifier from the Linux blacklist
- Don't want to skip this important structure in the Linux kernel
- This fixes https://github.com/bootlin/elixir/issues/207

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2021-01-08 15:02:44 +01:00
Maxime Chretien
be5e6fd6b4 web / lib : Improve family checking
This fixes https://github.com/bootlin/elixir/issues/175

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-07-09 17:04:37 +02:00
Maxime Chretien
603db9e55b Index CONFIG_ references in makefiles
Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-06-12 16:04:34 +02:00
Maxime Chretien
fd2335beaf queries: Support C macros in DT files
Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-06-12 15:16:15 +02:00
Maxime Chretien
5e756424d0 lib.py: Add default to the blacklist and sort it
Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-06-12 12:31:29 +02:00
Maxime Chretien
781c5d6e2c lib.py/script.sh: Handle ctags __anon correctly
Disable __anon output from ctags instead of blacklisting them in lib.py

See : https://github.com/universal-ctags/ctags/issues/2572

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-06-11 14:55:02 +02:00
Maxime Chretien
fdfc18c92d lib.py: Fix syntax error
Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-06-11 11:04:27 +02:00
Maxime Chretien
e7dc926ec5 lib.py: Reject C++ destructors
We don't need to add destructors as constructors are already in the
database.

Constructors and destructors are never far away so it's
redundant.

And the tokenizer don't support destructors so only constructors are
used from the database.

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-06-11 10:56:08 +02:00
Maxime Chretien
5b458c3ef5 lib.py: Add __ in the blacklist
It is used here https://elixir.bootlin.com/linux/v5.7/source/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c#L1872

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-06-11 10:49:20 +02:00
Maxime Chretien
0a15981c4b lib.py: Reject errors from ctags (strings starting with __anon)
Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-06-11 10:36:11 +02:00
Maxime Chretien
c1abf3d134 lib: Move decode function to lib.py
decode() is needed by FindCompatibleDts but importing query.py result in
an instantiation of the database (query.py line 29).

Moving it to lib.py allows to import it for FindCompatibleDts without
opening the database.

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-06-10 10:28:07 +02:00
Maxime Chretien
a69230f986 lib.py: Add int, long and char to the blacklist
They are sometimes seen as struct members here :
https://elixir.bootlin.com/linux/latest/source/arch/m68k/include/asm/amigahw.h#L278

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-06-02 10:18:55 +02:00
Maxime Chretien
72571fbfd9 database: Add support for Kconfig et Devicetree files
This brings the idea of file families, each ident is identified by his
family and can be referenced in compatible families.

For exemple :
- A Kconfig ident can be referenced in a C file but not in a Devicetree file.
- A Devicetree ident is only referenced in Devicetree files.
- A C ident is only referenced in C files.

Kconfig idents are defined without the CONFIG_ at the beginning.
We add it while indexing for an easier processing of other files.

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-05-22 10:29:24 +02:00
Maxime Chretien
40fcdd5601 lib.py : Add 'return' in the blacklist
This shouldn't be seen as an identifier because it is used in nearly every
files

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-05-14 10:37:52 +02:00
Michael Opdenacker
cb495269eb Remove blacklisted structure names
- Those were important structures in Linux
  They deserve to be indexed.

- This will require re-indexing, so this will take a bit
  of time to be fixed in the database

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-01-29 08:11:27 +01:00
Michael Opdenacker
f4129147ad Blacklist "else" and "endif"
- This fixes https://github.com/bootlin/elixir/issues/76

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-17 15:45:42 +01:00
Michael Opdenacker
c1af301390 Fix variable name in previous commit
- Most probably a typo

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-17 10:39:39 +01:00
Carmeli Tamir
6fcfc0ca79 Fixed path dependency in lib.py 2019-12-15 15:15:09 -05:00
Michael Opdenacker
51a6dff682 Python parentheses coding style fixes
- According to https://www.python.org/dev/peps/pep-0008/

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-01 07:01:26 +01:00
Michael Opdenacker
aca12c5cca Add support for more source file extensions, in particular .S
- Suggested by Armijn Hemel
  https://github.com/bootlin/elixir/issues/27

- In particular, functions defined in assembly
  are now supported. Look for "memcpy" for example.

A database rebuild is required. Will increase the version
number in the next commit

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-10-08 11:33:52 +02:00
Michael Opdenacker
453e8a127c Factorize the definition of supported extensions
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-10-08 07:33:36 +02:00
Michael Opdenacker
c6aee2ad9d Improve progress reporting + factorize LXR_DATA_DIR access
- For long runs, allows to see which project we are in, and the
  percentage of processed tags

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-10-03 13:33:26 +02:00
Michael Opdenacker
dad935cbc7 Minor update to symbol blacklist
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-10-01 09:35:29 +02:00
Michael Opdenacker
89b777fb4f Add some comments
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-09-23 14:34:20 +02:00
Michael Opdenacker
5d35c4dae8 Un-blacklist some symbol names
This caused important symbols to be ignored (at least for the
list of instances) See https://github.com/bootlin/elixir/issues/44

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-07-16 16:00:46 +02:00
Chen-Yu Tsai
d74914e699 Fall back to subprocess.check_output when subprocess.run is not available
On machines with Python < 3.5, subprocess.run is not available. In this
case, subprocess.check_output serves the same purpose [1].

This allows Elixir to run on older systems, such as Ubuntu 14.04 which
comes with Python 3.4.

[1] https://docs.python.org/3.5/library/subprocess.html#subprocess.check_output

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2018-04-10 07:36:02 +00:00
Michael Opdenacker
b4118f3f9e
Merge pull request #34 from plaes/master
Clean up unused imports
2018-04-05 10:53:43 +02:00
Mikaël Bouillot
537e6b3a7b Change business name 2018-02-15 21:27:00 +00:00
Priit Laes
f02c6469fa Clean up unused imports
Signed-off-by: Priit Laes <plaes@plaes.org>
2017-10-21 14:03:37 +03:00
Mikaël Bouillot
1b4c0fc7d4 Update notices to match the new license 2017-06-27 14:13:28 +02:00
Silvio Fricke
b7e1cd3215 change shebang to be more flexible
Python developers tend to use `virtualenv` then a fixed shebang is contra
productive.

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
2017-06-14 10:30:51 +02:00
Mikaël Bouillot
6df19c144c Turn query into function 2017-05-10 21:41:20 +02:00
Mikaël Bouillot
9c2cf2cf86 Use Perl non-greedy regex in tokenizer
We can now exclude C++ style comments and #includes,
in addition to C-style comments and strings.
2017-05-01 22:30:18 +02:00
Mikaël Bouillot
b04cc838dc Extend black list to small identifiers
The extended list was generated with a modified references database
that only stored the size of the records instead of the records
themselves. This list basically correponds to all references records
larger than 4 megabytes.
2017-03-27 09:08:56 +02:00
Mikaël Bouillot
3ef4641fc4 Style string literals 2017-03-23 17:33:32 +01:00
Mikaël Bouillot
832f7c8b6d Add license 2017-03-09 17:25:42 +01:00
Mikaël Bouillot
fabede0657 Restrict identifier matching rules with blacklist 2017-02-26 11:28:48 +01:00
Mikaël Bouillot
a37cd93a24 Relax identifier matching rules 2017-02-26 09:43:37 +01:00
Mikaël Bouillot
bc9722659e Correct binary output 2017-02-07 10:57:32 +01:00
Mikaël Bouillot
0bf34d7751 Database update script, new data format 2017-02-06 15:15:51 +01:00
Mikaël Bouillot
abbf08646a Split data module and add dummy element to iterators 2017-02-05 21:26:39 +01:00
Mikaël Bouillot
a479750bee Ident query and lots of data stuff 2017-02-05 21:02:10 +01:00
Mikaël Bouillot
4135084a0f Highlight comments 2017-02-05 11:34:33 +01:00
Mikaël Bouillot
8ad62ba1b6 Identifier matching rules 2017-02-05 11:14:48 +01:00
Mikaël Bouillot
cf0e1bd666 Directory and file queries 2017-02-05 10:27:36 +01:00
Mikaël Bouillot
10b9e273e7 Tweak script and print helpers 2017-02-05 08:38:43 +01:00
Mikaël Bouillot
2997686d70 Shell script and call from Python 2017-02-04 20:07:26 +01:00