this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implement pmenergy/pmsample stubs, should be sufficient for LLDB

+165
+2
src/CMakeLists.txt
··· 147 147 ${CMAKE_CURRENT_SOURCE_DIR}/opendirectory/include 148 148 ${CMAKE_CURRENT_SOURCE_DIR}/external/commoncrypto/include 149 149 ${CMAKE_CURRENT_SOURCE_DIR}/quarantine/include 150 + ${CMAKE_CURRENT_SOURCE_DIR}/libpmenergy/include 150 151 ${CMAKE_CURRENT_SOURCE_DIR}/copyfile/include 151 152 ${CMAKE_CURRENT_SOURCE_DIR}/external/zlib/include 152 153 ${CMAKE_CURRENT_SOURCE_DIR}/xar/include ··· 278 279 add_subdirectory(ServiceManagement) 279 280 add_subdirectory(xar) 280 281 add_subdirectory(libedit) 282 + add_subdirectory(libpmenergy) 281 283 add_subdirectory(external/libclosure) 282 284 add_subdirectory(external/compiler-rt/lib/builtins) 283 285 add_subdirectory(csu)
+22
src/libpmenergy/CMakeLists.txt
··· 1 + project(pmenergy) 2 + 3 + cmake_minimum_required(VERSION 2.4.0) 4 + 5 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdinc -D__DARWIN_UNIX03 -fPIC -w -ggdb") 6 + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -nostdlib") 7 + 8 + set(DYLIB_INSTALL_NAME "/usr/lib/libpmenergy.dylib") 9 + set(DYLIB_COMPAT_VERSION "1.0.0") 10 + set(DYLIB_CURRENT_VERSION "1.0.0") 11 + 12 + add_darling_library(pmenergy SHARED src/pmenergy.c) 13 + target_link_libraries(pmenergy PRIVATE system) 14 + 15 + ### 16 + 17 + set(DYLIB_INSTALL_NAME "/usr/lib/libpmsample.dylib") 18 + add_darling_library(pmsample SHARED src/pmsample.c) 19 + target_link_libraries(pmsample PRIVATE system) 20 + 21 + install(TARGETS pmenergy pmsample DESTINATION libexec/darling/usr/lib) 22 +
+46
src/libpmenergy/include/pmenergy.h
··· 1 + /* 2 + * Darling - pmenergy & pmsample stub 3 + * Copyright (c) 2018 Lubos Dolezel, All rights reserved. 4 + * 5 + * This library is free software; you can redistribute it and/or 6 + * modify it under the terms of the GNU Lesser General Public 7 + * License as published by the Free Software Foundation; either 8 + * version 3.0 of the License, or (at your option) any later version. 9 + * 10 + * This library is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 + * Lesser General Public License for more details. 14 + * 15 + * You should have received a copy of the GNU Lesser General Public 16 + * License along with this library. 17 + */ 18 + 19 + #ifndef _PMENERGY_H 20 + #define _PMENERGY_H 21 + #include <stdint.h> 22 + 23 + #ifdef __cplusplus 24 + extern "C" { 25 + #endif 26 + 27 + struct pm_task_energy_data 28 + { 29 + struct 30 + { 31 + uint64_t total_user, total_system, task_interrupt_wakeups, task_platform_idle_wakeups; 32 + } sti; 33 + 34 + uint64_t diskio_bytesread, diskio_byteswritten, pageins; 35 + }; 36 + 37 + typedef struct pm_task_energy_data pm_task_energy_data_t; 38 + 39 + uint64_t pm_energy_impact(const pm_task_energy_data_t* pme); 40 + 41 + #ifdef __cplusplus 42 + } 43 + #endif 44 + 45 + #endif 46 +
+45
src/libpmenergy/include/pmsample.h
··· 1 + /* 2 + * Darling - pmenergy & pmsample stub 3 + * Copyright (c) 2018 Lubos Dolezel, All rights reserved. 4 + * 5 + * This library is free software; you can redistribute it and/or 6 + * modify it under the terms of the GNU Lesser General Public 7 + * License as published by the Free Software Foundation; either 8 + * version 3.0 of the License, or (at your option) any later version. 9 + * 10 + * This library is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 + * Lesser General Public License for more details. 14 + * 15 + * You should have received a copy of the GNU Lesser General Public 16 + * License along with this library. 17 + */ 18 + 19 + #ifndef _PMSAMPLE_H 20 + #define _PMSAMPLE_H 21 + 22 + #include <stdint.h> 23 + #include <pmenergy.h> 24 + #include <mach/mach.h> 25 + #include <unistd.h> 26 + 27 + #ifdef __cplusplus 28 + extern "C" { 29 + #endif 30 + 31 + // These constants are made up!!! 32 + #define PM_SAMPLE_ALL 0xffffffff 33 + #define PM_SAMPLE_NAME 1 34 + #define PM_SAMPLE_INTERVAL 2 35 + #define PM_SAMPLE_CPU 4 36 + #define PM_SAMPLE_DISK 8 37 + 38 + int pm_sample_task_and_pid(task_t task, pid_t pid, pm_task_energy_data_t* pme, uint64_t mach_time, unsigned int flags); 39 + 40 + #ifdef __cplusplus 41 + } 42 + #endif 43 + 44 + #endif 45 +
+25
src/libpmenergy/src/pmenergy.c
··· 1 + /* 2 + * Darling - pmenergy & pmsample stub 3 + * Copyright (c) 2018 Lubos Dolezel, All rights reserved. 4 + * 5 + * This library is free software; you can redistribute it and/or 6 + * modify it under the terms of the GNU Lesser General Public 7 + * License as published by the Free Software Foundation; either 8 + * version 3.0 of the License, or (at your option) any later version. 9 + * 10 + * This library is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 + * Lesser General Public License for more details. 14 + * 15 + * You should have received a copy of the GNU Lesser General Public 16 + * License along with this library. 17 + */ 18 + 19 + #include "pmenergy.h" 20 + 21 + uint64_t pm_energy_impact(const pm_task_energy_data_t* pme) 22 + { 23 + return 0; 24 + } 25 +
+25
src/libpmenergy/src/pmsample.c
··· 1 + /* 2 + * Darling - pmenergy & pmsample stub 3 + * Copyright (c) 2018 Lubos Dolezel, All rights reserved. 4 + * 5 + * This library is free software; you can redistribute it and/or 6 + * modify it under the terms of the GNU Lesser General Public 7 + * License as published by the Free Software Foundation; either 8 + * version 3.0 of the License, or (at your option) any later version. 9 + * 10 + * This library is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 + * Lesser General Public License for more details. 14 + * 15 + * You should have received a copy of the GNU Lesser General Public 16 + * License along with this library. 17 + */ 18 + 19 + #include "pmsample.h" 20 + 21 + int pm_sample_task_and_pid(task_t task, pid_t pid, pm_task_energy_data_t* pme, uint64_t mach_time, unsigned int flags) 22 + { 23 + return 0; 24 + } 25 +