Commit c3b36dba authored by Linus Torvalds's avatar Linus Torvalds

Make threaded core-dump names use the tgid instead of the pid. Makes

sense now that we can dump all threads in one core-dump.

Fix from MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>
parent 3d0213fb
...@@ -1166,7 +1166,7 @@ void format_corename(char *corename, const char *pattern, long signr) ...@@ -1166,7 +1166,7 @@ void format_corename(char *corename, const char *pattern, long signr)
case 'p': case 'p':
pid_in_pattern = 1; pid_in_pattern = 1;
rc = snprintf(out_ptr, out_end - out_ptr, rc = snprintf(out_ptr, out_end - out_ptr,
"%d", current->pid); "%d", current->tgid);
if (rc > out_end - out_ptr) if (rc > out_end - out_ptr)
goto out; goto out;
out_ptr += rc; out_ptr += rc;
...@@ -1238,7 +1238,7 @@ void format_corename(char *corename, const char *pattern, long signr) ...@@ -1238,7 +1238,7 @@ void format_corename(char *corename, const char *pattern, long signr)
if (!pid_in_pattern if (!pid_in_pattern
&& (core_uses_pid || atomic_read(&current->mm->mm_users) != 1)) { && (core_uses_pid || atomic_read(&current->mm->mm_users) != 1)) {
rc = snprintf(out_ptr, out_end - out_ptr, rc = snprintf(out_ptr, out_end - out_ptr,
".%d", current->pid); ".%d", current->tgid);
if (rc > out_end - out_ptr) if (rc > out_end - out_ptr)
goto out; goto out;
out_ptr += rc; out_ptr += rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment