summaryrefslogtreecommitdiff
path: root/Libraries/LibC/serenity.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-02 20:28:29 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-02 20:29:50 +0100
commitfa97ff1c83cc80c2f857bdc70a58ff6a588c5d3d (patch)
tree86fd7a75bd23d292d4d85ac4eb4aa2814eea4a37 /Libraries/LibC/serenity.cpp
parent3879e5b9d454e08b301721ad3044f90d03026db3 (diff)
downloadserenity-fa97ff1c83cc80c2f857bdc70a58ff6a588c5d3d.zip
LibC: Allow opting into malloc() and free() performance event logging
If a program is started with LIBC_PROFILE_MALLOC in the environment, it will now generate PERF_EVENT_MALLOC and PERF_EVENT_FREE.
Diffstat (limited to 'Libraries/LibC/serenity.cpp')
-rw-r--r--Libraries/LibC/serenity.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibC/serenity.cpp b/Libraries/LibC/serenity.cpp
index 73c8aac3a7..d35b008522 100644
--- a/Libraries/LibC/serenity.cpp
+++ b/Libraries/LibC/serenity.cpp
@@ -79,4 +79,9 @@ int purge(int mode)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
+int perf_event(int type, uintptr_t arg1, uintptr_t arg2)
+{
+ int rc = syscall(SC_perf_event, type, arg1, arg2);
+ __RETURN_WITH_ERRNO(rc, rc, -1);
+}
}