aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorGary Guo <[email protected]>2023-11-04 14:56:56 +0000
committerMiguel Ojeda <[email protected]>2023-12-14 20:14:01 +0100
commit743766565dc0bdeedf7db419500031c7bdc84033 (patch)
treebcc357f4dfab31ed67c4c53d62f4dd87d4180737 /tools/perf/scripts/python/export-to-postgresql.py
parentbad098d76835c1379e1cf6afc935f8a7e050f83c (diff)
rust: bindings: rename const binding using sed
Currently, for `const`s that bindgen doesn't recognise, we define a helper constant with const <TYPE> BINDINGS_<NAME> = <NAME>; in `bindings_helper.h` and then we put pub const <NAME>: <TYPE> = BINDINGS_<NAME>; in `bindings/lib.rs`. This is fine since we currently only have 3 constants that are defined this way, but is going to be more annoying when more constants are added since every new constant needs to be defined in two places. This patch changes the way we define constant helpers to const <TYPE> RUST_CONST_HELPER_<NAME> = <NAME>; and then use `sed` to postprocess Rust code generated by bindgen to remove the distinct prefix, so users of the `bindings` crate can refer to the name directly. Reviewed-by: Benno Lossin <[email protected]> Reviewed-by: Andreas Hindborg <[email protected]> Reviewed-by: Martin Rodriguez Reboredo <[email protected]> Signed-off-by: Gary Guo <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Reworded for typos. ] Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions