xiaoxiang781216 commented on code in PR #8619: URL: https://github.com/apache/nuttx/pull/8619#discussion_r1123993333
########## Kconfig: ########## @@ -2006,6 +2006,65 @@ config FRAME_POINTER endmenu # Debug Options +menuconfig TRACE + bool "Enable tracepoints" + default n + depends on DRIVERS_NOTE Review Comment: depends on SCHED_INSTRUMENTATION ########## include/nuttx/trace.h: ########## @@ -0,0 +1,154 @@ +/**************************************************************************** + * include/nuttx/trace.h + * + * 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 __INCLUDE_NUTTX_TRACE_H +#define __INCLUDE_NUTTX_TRACE_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/sched_note.h> + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifdef CONFIG_TRACE +# define trace_begin(tag) SCHED_NOTE_BEGIN(tag) +# define trace_end(tag) SCHED_NOTE_END(tag) +#else +# define trace_begin(tag) +# define trace_end(tag) +#endif + +#ifdef CONFIG_TRACE_APP +# define app_trace_begin() trace_begin(NOTE_TAG_APP) +# define app_trace_end() trace_end(NOTE_TAG_APP) +#else +# define app_trace_begin() +# define app_trace_end() +#endif + +#ifdef CONFIG_TRACE_ARCH +# define arch_trace_begin() trace_begin(NOTE_TAG_ARCH) +# define arch_trace_end() trace_end(NOTE_TAG_ARCH) +#else +# define arch_trace_begin() +# define arch_trace_end() +#endif + +#ifdef CONFIG_TRACE_AUDIO +# define audio_trace_begin() trace_begin(NOTE_TAG_AUDIO) +# define audio_trace_end() trace_end(NOTE_TAG_AUDIO) +#else +# define audio_trace_begin() +# define audio_trace_end() +#endif + +#ifdef CONFIG_TRACE_BOARDS +# define boards_trace_begin() trace_begin(NOTE_TAG_BOARDS) +# define boards_trace_end() trace_end(NOTE_TAG_BOARDS) +#else +# define boards_trace_begin() +# define boards_trace_end() +#endif + +#ifdef CONFIG_TRACE_CRYPTO +# define crypto_trace_begin() trace_begin(NOTE_TAG_CRYPTO) +# define crypto_trace_end() trace_end(NOTE_TAG_CRYPTO) +#else +# define crypto_trace_begin() +# define crypto_trace_end() +#endif + +#ifdef CONFIG_TRACE_DRIVERS +# define drivers_trace_begin() trace_begin(NOTE_TAG_DRIVERS) +# define drivers_trace_end() trace_end(NOTE_TAG_DRIVERS) +#else +# define drivers_trace_begin() +# define drivers_trace_end() +#endif + +#ifdef CONFIG_TRACE_FS +# define fs_trace_begin() trace_begin(NOTE_TAG_FS) +# define fs_trace_end() trace_end(NOTE_TAG_FS) +#else +# define fs_trace_begin() +# define fs_trace_end() +#endif + +#ifdef CONFIG_TRACE_GRAPHICS +# define graphics_trace_begin() trace_begin(NOTE_TAG_GRAPHICS) +# define graphics_trace_end() trace_end(NOTE_TAG_GRAPHICS) +#else +# define graphics_trace_begin() +# define graphics_trace_end() +#endif + +#ifdef CONFIG_TRACE_LIBS +# define libs_trace_begin() trace_begin(NOTE_TAG_LIBS) +# define libs_trace_end() trace_end(NOTE_TAG_LIBS) +#else +# define libs_trace_begin() +# define libs_trace_end() +#endif + +#ifdef CONFIG_TRACE_MM +# define mm_trace_begin() trace_begin(NOTE_TAG_MM) +# define mm_trace_end() trace_end(NOTE_TAG_MM) +#else +# define mm_trace_begin() +# define mm_trace_end() +#endif + +#ifdef CONFIG_TRACE_NET +# define net_trace_begin() trace_begin(NOTE_TAG_NET) +# define net_trace_end() trace_end(NOTE_TAG_NET) +#else +# define net_trace_begin() +# define net_trace_end() +#endif + +#ifdef CONFIG_TRACE_SCHED +# define sched_trace_begin() trace_begin(NOTE_TAG_SCHED) +# define sched_trace_end() trace_end(NOTE_TAG_SCHED) +#else +# define sched_trace_begin() +# define sched_trace_end() +#endif + +#ifdef CONFIG_TRACE_VEDIO Review Comment: VEDIO->VIDEO ########## include/nuttx/trace.h: ########## @@ -0,0 +1,154 @@ +/**************************************************************************** + * include/nuttx/trace.h + * + * 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 __INCLUDE_NUTTX_TRACE_H +#define __INCLUDE_NUTTX_TRACE_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/sched_note.h> + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifdef CONFIG_TRACE +# define trace_begin(tag) SCHED_NOTE_BEGIN(tag) +# define trace_end(tag) SCHED_NOTE_END(tag) +#else +# define trace_begin(tag) +# define trace_end(tag) +#endif + +#ifdef CONFIG_TRACE_APP +# define app_trace_begin() trace_begin(NOTE_TAG_APP) +# define app_trace_end() trace_end(NOTE_TAG_APP) +#else +# define app_trace_begin() +# define app_trace_end() +#endif + +#ifdef CONFIG_TRACE_ARCH +# define arch_trace_begin() trace_begin(NOTE_TAG_ARCH) +# define arch_trace_end() trace_end(NOTE_TAG_ARCH) +#else +# define arch_trace_begin() +# define arch_trace_end() +#endif + +#ifdef CONFIG_TRACE_AUDIO +# define audio_trace_begin() trace_begin(NOTE_TAG_AUDIO) +# define audio_trace_end() trace_end(NOTE_TAG_AUDIO) +#else +# define audio_trace_begin() +# define audio_trace_end() +#endif + +#ifdef CONFIG_TRACE_BOARDS +# define boards_trace_begin() trace_begin(NOTE_TAG_BOARDS) +# define boards_trace_end() trace_end(NOTE_TAG_BOARDS) +#else +# define boards_trace_begin() +# define boards_trace_end() +#endif + +#ifdef CONFIG_TRACE_CRYPTO +# define crypto_trace_begin() trace_begin(NOTE_TAG_CRYPTO) +# define crypto_trace_end() trace_end(NOTE_TAG_CRYPTO) +#else +# define crypto_trace_begin() +# define crypto_trace_end() +#endif + +#ifdef CONFIG_TRACE_DRIVERS +# define drivers_trace_begin() trace_begin(NOTE_TAG_DRIVERS) +# define drivers_trace_end() trace_end(NOTE_TAG_DRIVERS) +#else +# define drivers_trace_begin() +# define drivers_trace_end() +#endif + +#ifdef CONFIG_TRACE_FS +# define fs_trace_begin() trace_begin(NOTE_TAG_FS) +# define fs_trace_end() trace_end(NOTE_TAG_FS) +#else +# define fs_trace_begin() +# define fs_trace_end() +#endif + +#ifdef CONFIG_TRACE_GRAPHICS +# define graphics_trace_begin() trace_begin(NOTE_TAG_GRAPHICS) +# define graphics_trace_end() trace_end(NOTE_TAG_GRAPHICS) +#else +# define graphics_trace_begin() +# define graphics_trace_end() +#endif + +#ifdef CONFIG_TRACE_LIBS +# define libs_trace_begin() trace_begin(NOTE_TAG_LIBS) +# define libs_trace_end() trace_end(NOTE_TAG_LIBS) +#else +# define libs_trace_begin() +# define libs_trace_end() +#endif + +#ifdef CONFIG_TRACE_MM +# define mm_trace_begin() trace_begin(NOTE_TAG_MM) +# define mm_trace_end() trace_end(NOTE_TAG_MM) +#else +# define mm_trace_begin() +# define mm_trace_end() +#endif + +#ifdef CONFIG_TRACE_NET +# define net_trace_begin() trace_begin(NOTE_TAG_NET) +# define net_trace_end() trace_end(NOTE_TAG_NET) +#else +# define net_trace_begin() +# define net_trace_end() +#endif + +#ifdef CONFIG_TRACE_SCHED +# define sched_trace_begin() trace_begin(NOTE_TAG_SCHED) +# define sched_trace_end() trace_end(NOTE_TAG_SCHED) +#else +# define sched_trace_begin() +# define sched_trace_end() +#endif + +#ifdef CONFIG_TRACE_VEDIO +# define vedio_trace_begin() trace_begin(NOTE_TAG_VEDIO) Review Comment: vedio->video -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org