summaryrefslogtreecommitdiff
path: root/utils/tracepoints/gen-tp-header.py
AgeCommit message (Collapse)Author
2022-11-24libcamera: tracing: fix header generation when built as subprojectBarnabás Pőcze
Building libcamera as a subproject is failing when tracepoints are enabled due to incorrectly managing the relative paths between the source and build directory while generating tracepoint headers. The previously used path = output.replace('include/', '', 1) logic is not sufficient to correctly determine the proper path when libcamera is built as a subproject, and does not correctly handle the relative paths, causing path to be processed as: 'subprojects/libcamera/include/libcamera/internal/tracepoints.h'.replace('include/', '', 1) which evaluates to 'subprojects/libcamera/libcamera/internal/tracepoints.h' so the tracepoints.h header file will try to include: #define TRACEPOINT_INCLUDE "subprojects/libcamera/libcamera/internal/tracepoints.h" which will fail. Fix it by using Python's pathlib to calculate the relative path of the output file with respect to the "include" directory of libcamera. This has been tested with Pipewire. For non-subproject builds it should generate the exact same path that was previously generated. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> [Kieran: Commit message expanded/reworded] Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-12-14utils: tracepoints: gen-tp-header: Add execute permissionBrian Olson
The gen-tp-header script does not have execute permissions set on the file. Add the execute permission to ensure that meson runs this script consistently in the same configuration as other scripts, without invoking python itself separately. Signed-off-by: Brian Olson <icic@bolson.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-11-03libcamera: tracing: Implement tracing infrastructurePaul Elder
Implement tracing infrastructure in libcamera. It takes .tp files, as required by lttng, and generates a tracepoint header and C file, as lttng requires. meson is updated accordingly to get it to compile with the rest of libcamera. Update the documentation accordingly. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
n> using namespace libcamera; bool SerializationTest::equals(const ControlInfoMap &lhs, const ControlInfoMap &rhs) { std::map<unsigned int, ControlInfo> rlhs; std::transform(lhs.begin(), lhs.end(), std::inserter(rlhs, rlhs.end()), [](const ControlInfoMap::value_type &v) -> decltype(rlhs)::value_type { return { v.first->id(), v.second }; }); std::map<unsigned int, ControlInfo> rrhs; std::transform(rhs.begin(), rhs.end(), std::inserter(rrhs, rrhs.end()), [](const ControlInfoMap::value_type &v) -> decltype(rrhs)::value_type { return { v.first->id(), v.second }; }); if (rlhs == rrhs) return true; cerr << "lhs:" << endl; for (const auto &value : rlhs) cerr << "- " << value.first << ": " << value.second.toString() << endl; cerr << "rhs:" << endl; for (const auto &value : rrhs) cerr << "- " << value.first << ": " << value.second.toString() << endl; return false; } bool SerializationTest::equals(const ControlList &lhs, const ControlList &rhs) { std::map<unsigned int, ControlValue> rlhs; std::transform(lhs.begin(), lhs.end(), std::inserter(rlhs, rlhs.end()), [](const std::pair<unsigned int, ControlValue> &v) -> decltype(rlhs)::value_type { return { v.first, v.second }; }); std::map<unsigned int, ControlValue> rrhs; std::transform(rhs.begin(), rhs.end(), std::inserter(rrhs, rrhs.end()), [](const std::pair<unsigned int, ControlValue> &v) -> decltype(rrhs)::value_type { return { v.first, v.second }; }); if (rlhs == rrhs) return true; cerr << "lhs:" << endl; for (const auto &value : rlhs) cerr << "- " << value.first << ": " << value.second.toString() << endl; cerr << "rhs:" << endl; for (const auto &value : rrhs) cerr << "- " << value.first << ": " << value.second.toString() << endl; return false; }