This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How to rewrite io_stat.c

0

Hello, i need to rewrite code io_stat.c to get in io_graph to get 2 more values (0,0001 and 0,00001). I try but i get values 5 sec and 0,3 sec ... can someone help? Here my rewrite file : http://www.sendspace.com/file/2dz8yc

asked 04 Dec '13, 11:53

Yszty's gravatar image

Yszty
1111
accept rate: 0%

I will try again. I need additional values of Tick interval in IO Graph. I need 100us, 10us and 1 us (microseconds). I have changed io_stat.c source code. In io_stat.c I change:

static const guint tick_interval_values[MAX_TICK_VALUES] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 6000000, 60000000 };

and

if (tick_interval_values[i] >= 6000000) {
        g_snprintf(str, sizeof(str), "%u min", tick_interval_values[i]/6000000);
    } else if (tick_interval_values[i] >= 10000000) {
        g_snprintf(str, sizeof(str), "%u sec", tick_interval_values[i]/100000);
    } else if (tick_interval_values[i] >= 100000) {
        g_snprintf(str, sizeof(str), "%u sec", tick_interval_values[i]/100000);
    } else if (tick_interval_values[i] >= 10000) {
        g_snprintf(str, sizeof(str), "0.%1u sec", (tick_interval_values[i]/10000)%10);
    } else if (tick_interval_values[i] >= 1000) {
        g_snprintf(str, sizeof(str), "0.%02u sec", (tick_interval_values[i]/1000)%10);
    } else if (tick_interval_values[i] >= 100) {
        g_snprintf(str, sizeof(str), "0.%03u sec", (tick_interval_values[i]/100)%10);
    } else if (tick_interval_values[i] >= 10) {
        g_snprintf(str, sizeof(str), "0.%04u sec", (tick_interval_values[i]/10)%10);
    } else if (tick_interval_values[i] >= 1) {
        g_snprintf(str, sizeof(str), "0.%05u sec", (tick_interval_values[i])%10);
    } else {
        g_snprintf(str, sizeof(str), "0.%06u sec", (tick_interval_values[i]*10)%10);
    }

But it does not work. Could you look and help me improve my code? I am begginer in this subject. I think that it would be helpful for many users.

Regards.

(10 Dec '13, 04:03) Yszty