Page MenuHomeFreeBSD

Fix tracking unknown syscalls for counts.
ClosedPublic

Authored by bdrewery on Oct 3 2015, 9:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 7:49 PM
Unknown Object (File)
Jan 9 2024, 8:51 AM
Unknown Object (File)
Dec 28 2023, 8:42 AM
Unknown Object (File)
Dec 16 2023, 10:27 PM
Unknown Object (File)
Nov 24 2023, 8:20 AM
Unknown Object (File)
Aug 10 2023, 9:41 AM
Unknown Object (File)
Jun 15 2023, 4:32 AM
Unknown Object (File)
Jun 13 2023, 7:17 AM
Subscribers

Details

Summary

This now makes get_syscall() add the syscall into a list if it is not found.
This fixes the counts not tracking unknown syscalls and also simplifies some of
the code to not have to check if sc is valid.

I tried converting this to ohash, but it is an awful library. I gave up for
now. This works and be optimized more later.

Test Plan

A lot of truss and truss -c.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bdrewery retitled this revision from to Fix tracking unknown syscalls for counts..
bdrewery updated this object.
bdrewery edited the test plan for this revision. (Show Details)
bdrewery added a reviewer: jhb.

You could actually use hcreate(). It's not a great API in that it only supports a single hash table, but that would be ok for truss. I don't think you need to do that before commit though.

usr.bin/truss/syscalls.c
1594 ↗(On Diff #9107)

This is the same as LongHex. You can either move the Unknown case so it shares its body, or just use LongHex directly when adding a dummy entry. I prefer the latter.

In D3792#78754, @jhb wrote:

You could actually use hcreate(). It's not a great API in that it only supports a single hash table, but that would be ok for truss. I don't think you need to do that before commit though.

I was hesitant about hcreate due to the db dependency. I wasn't sure if it was acceptable these days. I'll look at it again.

This revision was automatically updated to reflect the committed changes.