void smbprofile_dump(void);
-void smbprofile_cleanup(pid_t pid);
+void smbprofile_cleanup(pid_t pid, pid_t dst);
void smbprofile_stats_accumulate(struct profile_stats *acc,
const struct profile_stats *add);
void smbprofile_collect(struct profile_stats *stats);
return;
}
-static inline void smbprofile_cleanup(pid_t pid)
+static inline void smbprofile_cleanup(pid_t pid, pid_t dst)
{
return;
}
return;
}
-void smbprofile_cleanup(pid_t pid)
+void smbprofile_cleanup(pid_t pid, pid_t dst)
{
TDB_DATA key = { .dptr = (uint8_t *)&pid, .dsize = sizeof(pid) };
struct profile_stats s = {};
tdb_delete(smbprofile_state.internal.db->tdb, key);
tdb_chainunlock(smbprofile_state.internal.db->tdb, key);
- pid = getpid();
+ pid = dst;
ret = tdb_chainlock(smbprofile_state.internal.db->tdb, key);
if (ret != 0) {
return;
__func__, strerror(ret)));
}
- smbprofile_cleanup(pid);
+ smbprofile_cleanup(pid, getpid());
for (child = parent->children; child != NULL; child = child->next) {
if (child->pid == pid) {