public string Format(int syscall_index, Syscall syscall, SyscallVisibleField field) { switch (field) { case SyscallVisibleField.None: return null; case SyscallVisibleField.Process: return Util.FormatProcess (syscall.pid, syscall.tid, syscall.execname); case SyscallVisibleField.Timestamp: return Util.FormatTimestamp (syscall.timestamp); case SyscallVisibleField.Name: return syscall.name; case SyscallVisibleField.Arguments: return syscall.arguments; case SyscallVisibleField.ExtraInfo: return syscall.extra_info; case SyscallVisibleField.Result: return Util.FormatResult (syscall.have_result, syscall.result); default: Debug.Assert (false, "Not reached"); return null; } }
public int AppendSyscall(Syscall syscall) { syscall.index = syscalls.Count; uniquify_strings (ref syscall); syscalls.Add (syscall); if (SyscallInserted != null) SyscallInserted (syscall.index); return syscall.index; }
public void Serialize(TextWriter writer, Syscall syscall) { if (syscall.name == "open" && syscall.is_syscall_start) { writer.Write ("start.open: {0}: {1} ({2}:{3}): {4}\n", syscall.timestamp, syscall.execname, syscall.pid, syscall.tid, syscall.arguments); } if (syscall.name == "open" && syscall.is_syscall_end) { writer.Write ("return.open: {0}: {1} ({2}:{3}): {4}\n", syscall.timestamp, syscall.execname, syscall.pid, syscall.tid, syscall.result); } }
public string Format(int syscall_index, Syscall syscall, SyscallVisibleField field) { string text; switch (field) { case SyscallVisibleField.None: return null; case SyscallVisibleField.Process: text = Util.FormatProcess (syscall.pid, syscall.tid, syscall.execname); break; case SyscallVisibleField.Timestamp: text = Util.FormatTimestamp (syscall.timestamp); break; case SyscallVisibleField.Name: text = syscall.name; break; case SyscallVisibleField.Arguments: text = syscall.arguments; break; case SyscallVisibleField.ExtraInfo: text = syscall.extra_info; break; case SyscallVisibleField.Result: text = Util.FormatResult (syscall.have_result, syscall.result); break; default: Debug.Assert (false, "Not reached"); return null; } return highlight_matches (field, syscall_index, text); }
public void ModifySyscall(int num, Syscall syscall) { syscall.index = num; uniquify_strings (ref syscall); syscalls[num] = syscall; if (SyscallModified != null) SyscallModified (num); }
void uniquify_strings(ref Syscall syscall) { syscall.execname = unique_string (syscall.execname); syscall.name = unique_string (syscall.name); syscall.arguments = unique_string (syscall.arguments); syscall.extra_info = unique_string (syscall.extra_info); }