Skip to content

Commit

Permalink
libs/libc: currect usage of getpid/gettid in library
Browse files Browse the repository at this point in the history
Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Sep 19, 2023
1 parent 6e6ba06 commit e1e4dcf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions include/nuttx/sched_note.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@
sched_note_bprintf_ip(tag, SCHED_NOTE_IP, event, \
fmt, ##__VA_ARGS__)
# define sched_note_beginex(tag, str) \
sched_note_printf_ip(tag, SCHED_NOTE_IP, "B|%d|%s", gettid(), str)
sched_note_printf_ip(tag, SCHED_NOTE_IP, "B|%d|%s", _SCHED_GETTID(), str)
# define sched_note_endex(tag, str) \
sched_note_printf_ip(tag, SCHED_NOTE_IP, "E|%d|%s", gettid(), str)
sched_note_printf_ip(tag, SCHED_NOTE_IP, "E|%d|%s", _SCHED_GETTID(), str)
# define sched_note_mark(tag, str) \
sched_note_printf_ip(tag, SCHED_NOTE_IP, "I|%d|%s", gettid(), str)
sched_note_printf_ip(tag, SCHED_NOTE_IP, "I|%d|%s", _SCHED_GETTID(), str)
# define sched_note_counter(tag, name, value) \
sched_note_printf_ip(tag, SCHED_NOTE_IP, "C|%d|%s|%" PRId32, \
gettid(), name, value)
_SCHED_GETTID(), name, value)
# define sched_note_begin(tag) \
sched_note_string_ip(tag, SCHED_NOTE_IP, "B")
# define sched_note_end(tag) \
Expand Down
2 changes: 1 addition & 1 deletion libs/libc/gdbstub/lib_gdbstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ static void gdb_get_registers(FAR struct gdb_state_s *state)
int i;

reg = (FAR uint8_t *)tcb->xcp.regs;
if (state->pid == getpid())
if (state->pid == _SCHED_GETPID())
{
if (up_interrupt_context())
{
Expand Down

0 comments on commit e1e4dcf

Please sign in to comment.