[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] outreachy task - adding information to debug prints


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Dafna Hirschfeld <dafna3@xxxxxxxxx>
  • Date: Mon, 12 Mar 2018 21:04:53 +0200
  • Delivery-date: Mon, 12 Mar 2018 19:05:20 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Hi,
I was given a task for applying outreachy internship. 

The ukdebug library supplies a  macro uk_printd, for debugging, it receives a debug level and a formatted string. (it should be enabled in the menuconfig).

My task is to add to the debug:
1. timestemp. The timestemp should be in seconds, with up to 3 digits precision.
2. name/pointer of the thread that issued the debug.

Each information will be added only if configured in menuconfig.

I think the new information can be added in the function _vprintd.

So two functions will be added to print.c:

static char* _get_timestamp() - returns a string of the current time or NULL according to configuration.

static char* _get_thread_name() - returns the name of the running thread or NULL if either this information is not enabled in the menuconfig or the sched library is not enabled.

static void* _get_thread_pointer() same as _get_thread_name() but returns a pointer to the thread.

issues:
1. currently there is no support for float "%f" format in vsnprintf, it should be added since the timestemp should be printed as a floating point, or workaround it with printing it in format something like "%d.%d" where the first %d is seconds and the second %d is miliseconds.

2. two functions:
char* get_thread_name()
char* get_thread_pointer()
should be added to the uksched library api.

3. "thread pointer", does it mean a pointer to the stack of the thread? maybe it's better to have other identifier, so a pointer to the stack won't be available outside of the library.

Dafna

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.