New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing Object Cores #59075
Introducing Object Cores #59075
Conversation
documentation? :-) |
Documentation? Gah! I knew I had to be forgetting something. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some notes. Mostly this seems reasonable. It would definitely good to see the patch ordering cleaned up for bisectability reasons.
I will say that I'm a little confused about how the stats framework is intended to work. Mostly I'd imagine "stats" to look like a per-type struct with fields that the type uses directly, like an set of atomic counts or a "last event time" value or whatever. And each type would then expose those stats for analysis via a "here's my stats" API of its own. Instead it looks like everyone is supposed to copy all the stats at once for every object in an opaque blob? What's the advantage there?
6187e1d
to
7f5ad9e
Compare
Adds the infrastructure to integrate statistics into the object core. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Integrates object core statistics framework into the following kernel objects: sys_mem_blocks, k_mem_slab threads, _cpu, z_kernel Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Creates a test to verify that kernel objects can be found within the object core framework. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Creates a set of tests to verify that the top-level k_obj_core_stats_xxx() routines behave as expected. Note that this test is not meant to test the details of the object core statistics operator function pointers. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Adds a test to test the objects integrated into the object core statistics framework. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Adds documentation for both object cores and object core statistics. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Changing the name of the routine test_obj_core_stats_deregister() to something shorter (test_obj_core_stats_dereg) has been found to be a workaround to the issue identified in zephyrproject-rtos#61087. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
5ddb5a4
bbdc0eb
to
5ddb5a4
Compare
Needed to fix a build issue stemming from the use of z_current_get() instead of k_current_get(). (A recent commit renamed z_current_get). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What a neat feature. The docs page does an excellent job explaining the idea and layout.
PR looks great.
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
6ee558a
to
772d7a0
Compare
Pulls in the latest percepio module updates that alter how it accesses the k_mem_slab structure (due to changes from this PR). Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
772d7a0
to
426861e
Compare
@jhedberg andyross already approved that earlier, please take this into 3.5 :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for docs
Introducing object cores in response to #57672.
Zephyr objects can have a special structure embedded within them (an object core). Zephyr objects of the same type are linked together through this object core. Additional functionality can be linked to the object core (such as statistics tracking). This can then provide a uniform means to access that additional functionality without needing to develop many custom interfaces. In the case of object cores, debugging tools can walk the object lists and obtain information about the objects.
The current iteration of object cores is quite minimal. The have a list node, a back pointer to the object type list of which it is a part, and an optional pointer to "raw" stats information. The object type contains a list node (linking different object types together), a list of all linked zephyr objects of that type, an ID and obj_core offset (to be leveraged by debugging tools to be able to identify and easily find relevant data of the object type), and an optional pointer to the a statistics descriptor.
Basic statistics operations include getting raw stats data, cooked stats data, resetting, enabling and disabling stats gathering. Not all functionality is required to be implemented--only what makes sense for the object.