-
Notifications
You must be signed in to change notification settings - Fork 590
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# ############################################################################## | ||
# apps/examples/notedump/CMakeLists.txt | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
# license agreements. See the NOTICE file distributed with this work for | ||
# additional information regarding copyright ownership. The ASF licenses this | ||
# file to you under the Apache License, Version 2.0 (the "License"); you may not | ||
# use this file except in compliance with the License. You may obtain a copy of | ||
# the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations under | ||
# the License. | ||
# | ||
# ############################################################################## | ||
|
||
if(CONFIG_EXAMPLES_NOTEDUMP) | ||
nuttx_add_application(NAME notedump) | ||
endif() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# For a description of the syntax of this configuration file, | ||
# see the file kconfig-language.txt in the NuttX tools repository. | ||
# | ||
|
||
config EXAMPLES_NOTEDUMP | ||
tristate "Note dump example" | ||
default n | ||
depends on SCHED_INSTRUMENTATION_DUMP && NET_UDP | ||
---help--- | ||
Enable the Note dump example | ||
|
||
if EXAMPLES_NOTEDUMP | ||
|
||
config EXAMPLES_NOTEDUMP_PROGNAME | ||
string "Program name" | ||
default "notedump" | ||
---help--- | ||
This is the name of the program that will be used when the NSH ELF | ||
program is installed. | ||
|
||
config EXAMPLES_NOTEDUMP_PRIORITY | ||
int "Note dump task priority" | ||
default 100 | ||
|
||
config EXAMPLES_NOTEDUMP_STACKSIZE | ||
int "Note dump stack size" | ||
default DEFAULT_TASK_STACKSIZE | ||
|
||
endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
############################################################################ | ||
# apps/examples/notedump/Make.defs | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. The | ||
# ASF licenses this file to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance with the | ||
# License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
############################################################################ | ||
|
||
ifneq ($(CONFIG_EXAMPLES_NOTEDUMP),) | ||
CONFIGURED_APPS += $(APPDIR)/examples/notedump | ||
endif |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,32 @@ | ||||||
############################################################################ | ||||||
# apps/examples/notedump/Makefile | ||||||
# | ||||||
# SPDX-License-Identifier: Apache-2.0 | ||||||
# | ||||||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||||||
# contributor license agreements. See the NOTICE file distributed with | ||||||
# this work for additional information regarding copyright ownership. The | ||||||
# ASF licenses this file to you under the Apache License, Version 2.0 (the | ||||||
# "License"); you may not use this file except in compliance with the | ||||||
# License. You may obtain a copy of the License at | ||||||
# | ||||||
# http://www.apache.org/licenses/LICENSE-2.0 | ||||||
# | ||||||
# Unless required by applicable law or agreed to in writing, software | ||||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||||||
# License for the specific language governing permissions and limitations | ||||||
# under the License. | ||||||
# | ||||||
############################################################################ | ||||||
|
||||||
include $(APPDIR)/Make.defs | ||||||
|
||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
MAINSRC = notedump_main.c | ||||||
|
||||||
include $(APPDIR)/Application.mk |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/**************************************************************************** | ||
* apps/examples/notedump/notedump.h | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. The | ||
* ASF licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
****************************************************************************/ | ||
|
||
#ifndef __APPS_EXAMPLES_NOTEDUMP_H | ||
#define __APPS_EXAMPLES_NOTEDUMP_H | ||
|
||
/**************************************************************************** | ||
* Included Files | ||
****************************************************************************/ | ||
|
||
#ifdef EXAMPLES_UDP_HOST | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where is EXAMPLES_UDP_HOST define? |
||
#else | ||
# include <debug.h> | ||
#endif | ||
|
||
#include <arpa/inet.h> | ||
|
||
/**************************************************************************** | ||
* Pre-processor Definitions | ||
****************************************************************************/ | ||
|
||
#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 | ||
Comment on lines
+41
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
#ifndef CONFIG_EXAMPLES_NOTEDUMP_SERVER_PORTNO | ||
# define CONFIG_EXAMPLES_NOTEDUMP_SERVER_PORTNO 6666 | ||
#endif | ||
|
||
#ifndef CONFIG_EXAMPLES_NOTEDUMP_METRIC_FREQ | ||
# define CONFIG_EXAMPLES_NOTEDUMP_METRIC_FREQ 10 | ||
#endif | ||
|
||
#endif /* __APPS_EXAMPLES_NOTEDUMP_H */ |
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?