Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
embedded-linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Maul
embedded-linux
Commits
75b0c028
Commit
75b0c028
authored
5 months ago
by
Ruben Otto
Browse files
Options
Downloads
Patches
Plain Diff
docs: add userspace communication to readme
parent
23f42481
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+25
-0
25 additions, 0 deletions
README.md
with
25 additions
and
0 deletions
README.md
+
25
−
0
View file @
75b0c028
...
...
@@ -20,3 +20,28 @@ The binaries will be in:
-
`build/daemon/daemon`
-
`build/clients/*`
## Communication
### Userspace
The client programs that aggregate the desired system data may send them to the daemon process.
This is done via a simple packet,
`daemon_measurement_t`
which is defined in
[
`common/include/protocol.h`
](
common/include/protocol.h
)
:
```
c
#define MAX_DAEMON_PACKET_SIZE PIPE_BUF
#define DAEMON_PACKET_HEADER_SIZE sizeof(u_int8_t) + sizeof(u_int16_t)
#define MAX_DAEMON_PACKET_DATA_SIZE MAX_DAEMON_PACKET_SIZE - DAEMON_PACKET_HEADER_SIZE
typedef
struct
{
uint8_t
measurement_id
;
uint16_t
size
;
uint8_t
data
[
MAX_DAEMON_PACKET_DATA_SIZE
];
}
daemon_measurement_t
;
```
The packet size equals to the size of
`PIPE_BUF`
(4096).
The communication to the deamon is implemented via a named pipe, the size ensure that the packet is atomic, i.e. it is written to the pipe in one go.
-
The first byte contains the measurement id, so the maximum number of different measurements client is 255.
-
The second and third bytes contain the size of the data in the packet.
-
All following bytes contain the data.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment