-
Notifications
You must be signed in to change notification settings - Fork 589
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
examples/notedump: Add a example to dump trace data by udp #3026
Conversation
[Experimental Bot, please feedback here] No, this PR does not fully meet the NuttX requirements. Here's why and how to fix it:
Example of Improved PR Description:
NuttShell (NSH) NuttX-12.8.0
NuttShell (NSH) NuttX-12.8.0 nsh> notedump 192.168.31.100 6666 (invalid server IP) nsh> notedump 192.168.31.9 6666 (with large amounts of trace data)
By addressing these points, your PR will be much clearer, more complete, and more likely to be accepted. Remember to keep the language concise and focused on the technical details. |
c8beebf
to
de11c70
Compare
Add example to send the trace data by udp Signed-off-by: Yang Wei <[email protected]>
PROGNAME = $(CONFIG_EXAMPLES_NOTEDUMP_PROGNAME) | ||
PRIORITY = $(CONFIG_EXAMPLES_NOTEDUMP_PRIORITY) | ||
STACKSIZE = $(CONFIG_EXAMPLES_NOTEDUMP_STACKSIZE) | ||
MODULE = $(CONFIG_EXAMPLES_NOTEDUMP_) |
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.
MODULE = $(CONFIG_EXAMPLES_NOTEDUMP_) | |
MODULE = $(CONFIG_EXAMPLES_NOTEDUMP) |
* Included Files | ||
****************************************************************************/ | ||
|
||
#ifdef EXAMPLES_UDP_HOST |
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.
where is EXAMPLES_UDP_HOST define?
static uint32_t g_udpserver_ipv4; | ||
static uint32_t g_udpserver_port; | ||
static uint32_t note_sent_bytes; |
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.
move all global variable to stack
|
||
/* Now, sleep a bit. */ | ||
|
||
sleep(1); |
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.
sleep(1); |
maybe we could remove this sleep since read note_fd is block mode
#ifdef CONFIG_EXAMPLES_UDP_IPv6 | ||
# define AF_INETX AF_INET6 | ||
# define PF_INETX PF_INET6 | ||
#else | ||
# define AF_INETX AF_INET | ||
# define PF_INETX PF_INET | ||
#endif |
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.
- Should we replace
EXAMPLES_UDP_IPv6
withNET_IPv6
? - Could you explain where are
AF_INETX
andPF_INETX
used for?
default n | ||
depends on SCHED_INSTRUMENTATION_DUMP && NET_UDP | ||
---help--- | ||
Enable the Note dump example |
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.
Maybe the help text can include a short blurb about what the note dump example does? Something like: "This example reads data from the Note driver (/dev/note/ram) and sends it by UDP to the server-addr and server-port specified by command line arguments." WDYT?
Summary
Add a example to send the note trace data by udp
Usage:
Impact
Testing