-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Livestat: A User Tool to dynamically display basekernel stats #252
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks good! Just a few little things to fix below.
kernel/device.c
Outdated
@@ -143,3 +159,18 @@ const char * device_name( struct device *d ) | |||
{ | |||
return d->driver->name; | |||
} | |||
|
|||
void device_driver_get_stats(char * name, struct device_driver_stats * s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please factor out the matter of finding a driver by name into a separate function:
struct device_driver * device_driver_lookup( const char *name )
And then also use that in driver_open
.
kernel/syscall_handler.c
Outdated
@@ -584,6 +593,12 @@ int sys_system_rtc( struct rtc_time *t ) | |||
return 0; | |||
} | |||
|
|||
int sys_device_driver_stats(char * name, struct device_driver_stats * stats) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const char *name
and is_valid_string(name)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_valid_pointer(stats)
Addresses #231
Overview
Livestat is a user lever program that is meant to display a dynamic graphic of different basekernel statistics. Version 1 allows the user to look at Buffer Cache, Process, Device Driver, and System statistics.
Testing
Statworkload was developed to test this program. Statworkload is meant to simulate different workloads and produce interesting statistics.
Bugs
On some occasions, the combination of running statworkload and livestat causes livestat to segfault.
Misc. Notes
strdup was added to library/string.c to be used in livestat. Also, data types in all stats structs were changed from u_int32s and u_int64s to ints.
Future Enhancements
In the future, additional statistics should be added. In particular, memory utilization in pages and kernel mallocs should be tracked.