Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions include/sys/perf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Phoenix-RTOS
*
* libphoenix
*
* sys/perf
*
* Copyright 2025 Phoenix Systems
* Author: Adam Greloch
*
* %LICENSE%
*/

#ifndef _LIBPHOENIX_SYS_PERF_H_
#define _LIBPHOENIX_SYS_PERF_H_

#include <phoenix/perf.h>

Check failure on line 17 in include/sys/perf.h

View workflow job for this annotation

GitHub Actions / call-ci / build (armv8m33-mcxn94x-frdm)

phoenix/perf.h: No such file or directory

Check failure on line 17 in include/sys/perf.h

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7a9-zynq7000-zedboard)

phoenix/perf.h: No such file or directory

Check failure on line 17 in include/sys/perf.h

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7a9-zynq7000-qemu)

phoenix/perf.h: No such file or directory

Check failure on line 17 in include/sys/perf.h

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7m4-stm32l4x6-nucleo)

phoenix/perf.h: No such file or directory

Check failure on line 17 in include/sys/perf.h

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7a9-zynq7000-zturn)

phoenix/perf.h: No such file or directory

Check failure on line 17 in include/sys/perf.h

View workflow job for this annotation

GitHub Actions / call-ci / build (armv7m7-imxrt117x-evk)

phoenix/perf.h: No such file or directory

Check failure on line 17 in include/sys/perf.h

View workflow job for this annotation

GitHub Actions / call-ci / build (ia32-generic-qemu)

phoenix/perf.h: No such file or directory

Check failure on line 17 in include/sys/perf.h

View workflow job for this annotation

GitHub Actions / call-ci / build (sparcv8leon-gr716-mini)

phoenix/perf.h: No such file or directory

Check failure on line 17 in include/sys/perf.h

View workflow job for this annotation

GitHub Actions / call-ci / build (sparcv8leon-generic-qemu)

phoenix/perf.h: No such file or directory
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif


int perf_start(perf_mode_t mode, unsigned int flags, void *arg, size_t sz);


int perf_read(perf_mode_t mode, void *buffer, size_t bufsz, int chan);


int perf_stop(perf_mode_t mode);


int perf_finish(perf_mode_t mode);


#ifdef __cplusplus
}
#endif


#endif
9 changes: 0 additions & 9 deletions include/sys/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ extern void _errno_new(struct __errno_t *e);
extern void _errno_remove(struct __errno_t *e);


extern int perf_start(unsigned pid);


extern int perf_read(void *buffer, size_t bufsz);


extern int perf_finish(void);


extern int gettid(void);


Expand Down
2 changes: 1 addition & 1 deletion sys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
#

OBJS += $(addprefix $(PREFIX_O)sys/, events.o ioctl.o list.o mount.o rb.o resource.o select.o \
semaphore.o socket.o stat.o statvfs.o threads.o time.o times.o wait.o uio.o proto.o mman.o uname.o)
semaphore.o socket.o stat.o statvfs.o threads.o time.o times.o wait.o uio.o proto.o mman.o uname.o perf.o)
43 changes: 43 additions & 0 deletions sys/perf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Phoenix-RTOS
*
* libphoenix
*
* sys/perf
*
* Copyright 2025 Phoenix Systems
* Author: Adam Greloch
*
* %LICENSE%
*/

#include <sys/perf.h>

extern int sys_perf_start(int mode, unsigned int flags, void *arg, size_t sz);
extern int sys_perf_read(int mode, void *buffer, size_t bufsz, int chan);
extern int sys_perf_stop(int mode);
extern int sys_perf_finish(int mode);


int perf_start(perf_mode_t mode, unsigned int flags, void *arg, size_t sz)
{
return sys_perf_start((int)mode, flags, arg, sz);
}


int perf_read(perf_mode_t mode, void *buffer, size_t bufsz, int chan)
{
return sys_perf_read((int)mode, buffer, bufsz, chan);
}


int perf_stop(perf_mode_t mode)
{
return sys_perf_stop((int)mode);
}


int perf_finish(perf_mode_t mode)
{
return sys_perf_finish((int)mode);
}
Loading