17153N/A // where factor10 is integer and x < 10
17153N/A // so we new_max has only 1 significant digit
17153N/A- unsigned factor10 = std::pow(10.0, std::floor(std::log10(coef10)));
17153N/A+ unsigned factor10 = std::pow(10.0, std::floor(std::log10((double)coef10)));
17153N/A coef10 = std::ceil(coef10 / double(factor10)) * factor10;
17153N/A // then make coef10 divisible by num_bars
17153N/A g_assert(coef10 % g->num_bars() == 0);
17153N/A new_max = coef10 * (1UL << (base10 * 10));
17153N/A- procman_debug("bak %u new_max %u pow2 %u coef10 %u", bak_max, new_max, pow2, coef10);
17153N/A+ //procman_debug("bak %u new_max %u pow2 %u coef10 %u", bak_max, new_max, pow2, coef10);
17153N/A- procman_debug("overflow detected: bak=%u new=%u", bak_max, new_max);
17153N/A+ //procman_debug("overflow detected: bak=%u new=%u", bak_max, new_max);
17153N/A+ /* we have to optimize the performance of libgtop, because in some low
17153N/A+ level machine, to update the information will occupy too much cpu.
17153N/A+ Here I would like to make a little update:
17153N/A+ so as to let glibtop_get_netlist() only return the ones whose first
17153N/A+ character of name is the same withthe first one in their module,
17153N/A+ glibtop_get_netload() just try to find these devices, for example,
17153N/A+ We do the check in glibtop_get_netlist(), I think this will
17153N/A+ accelerate the transaction lots. Also this will not affect the
17153N/A+ glibtop_get_netlist() will return all devices with class "net".
17153N/A ifnames = glibtop_get_netlist(&netlist);