| 124 | } |
| 125 | |
| 126 | static inline void signal_pkg_status(unsigned long proc_id) |
| 127 | { |
| 128 | time_t t; |
| 129 | |
| 130 | if (IPC_FD_WRITE(proc_id)<=0) |
| 131 | return; |
| 132 | |
| 133 | t = time(NULL); |
| 134 | if (t>marker_t[proc_id]+1) { |
| 135 | |
| 136 | if (proc_id==process_no) { |
| 137 | /* avoid sending IPC to ourselves, as it will get executed |
| 138 | * after we ar done with pkg_status job; better do it inline */ |
| 139 | rpc_get_pkg_stats(process_no, NULL); |
| 140 | } else { |
| 141 | if (ipc_send_rpc( proc_id, rpc_get_pkg_stats, NULL)<0) { |
| 142 | LM_ERR("failed to trigger pkg stats for process %ld\n", |
| 143 | proc_id ); |
| 144 | return; |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | marker_t[proc_id] = t; |
| 149 | usleep(20); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | static unsigned long get_pkg_total_size( void* proc_id) |
| 154 | { |
no test coverage detected