driver/note: Fix compilation error when CONFIG_SYSLOG_TO_SCHED_NOTE=y

Add compilation condition for 'nx_vsyslog' syscall.
Export 'sched_note_printf_ip' syscall when CONFIG_SYSLOG_TO_SCHED_NOTE=y
Put the implementation of sched_note_printf_ip in libc/misc/lib_note.c

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
This commit is contained in:
yukangzhi
2025-04-24 19:28:10 +08:00
committed by Alan C. Assis
parent 5f92db54a6
commit 1b22f8c65b
7 changed files with 84 additions and 30 deletions
+4
View File
@@ -122,6 +122,10 @@ if(CONFIG_FDCHECK)
list(APPEND SRCS lib_fdcheck.c)
endif()
if(CONFIG_SCHED_INSTRUMENTATION_DUMP)
list(APPEND SRCS lib_note.c)
endif()
if(NOT CONFIG_LIBC_UNAME_DISABLE_TIMESTAMP)
add_custom_target(
always_rebuild_lib_utsname
+6
View File
@@ -80,6 +80,12 @@ ifeq ($(CONFIG_FDCHECK),y)
CSRCS += lib_fdcheck.c
endif
# Note support
ifeq ($(CONFIG_SCHED_INSTRUMENTATION_DUMP),y)
CSRCS += lib_note.c
endif
# To ensure uname information is newest,
# add lib_utsname.o to phony target for force rebuild
+49
View File
@@ -0,0 +1,49 @@
/****************************************************************************
* libs/libc/misc/lib_note.c
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdarg.h>
#include <syslog.h>
#include <nuttx/sched_note.h>
/****************************************************************************
* Public Functions
****************************************************************************/
#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
void sched_note_printf_ip(uint32_t tag, uintptr_t ip,
FAR const char *fmt,
uint32_t type, ...)
{
va_list va;
va_start(va, type);
sched_note_vprintf_ip(tag, ip, fmt, type, &va);
va_end(va);
}
#endif /* CONFIG_SCHED_INSTRUMENTATION_DUMP */