View | Details | Raw Unified | Return to ticket 304 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/plugins/jobacct_gather/common/common_jag.c (-15 / +6 lines)
Lines 59-67 static int my_pagesize = 0; Link Here
59
static DIR  *slash_proc = NULL;
59
static DIR  *slash_proc = NULL;
60
static int energy_profile = ENERGY_DATA_JOULES_TASK;
60
static int energy_profile = ENERGY_DATA_JOULES_TASK;
61
61
62
/* return weighted frequency in mhz */
62
/* return current frequency in mhz */
63
static uint32_t _update_weighted_freq(struct jobacctinfo *jobacct,
63
static int _current_freq(struct jobacctinfo *jobacct, char * sbuf)
64
				      char * sbuf)
65
{
64
{
66
	int thisfreq = 0;
65
	int thisfreq = 0;
67
66
Lines 70-84 static uint32_t _update_weighted_freq(struct jobacctinfo *jobacct, Link Here
70
		thisfreq = cpunfo_frequency;
69
		thisfreq = cpunfo_frequency;
71
	else
70
	else
72
		sscanf(sbuf, "%d", &thisfreq);
71
		sscanf(sbuf, "%d", &thisfreq);
73
72
	return thisfreq;
74
	jobacct->current_weighted_freq =
75
		jobacct->current_weighted_freq +
76
		jobacct->this_sampled_cputime * thisfreq;
77
	if (jobacct->last_total_cputime) {
78
		return (jobacct->current_weighted_freq /
79
			jobacct->last_total_cputime);
80
	} else
81
		return thisfreq;
82
}
73
}
83
74
84
static char *_skipdot (char *str)
75
static char *_skipdot (char *str)
Lines 664-672 extern void jag_common_poll_data( Link Here
664
				_get_sys_interface_freq_line(
655
				_get_sys_interface_freq_line(
665
					prec->last_cpu,
656
					prec->last_cpu,
666
					"cpuinfo_cur_freq", sbuf);
657
					"cpuinfo_cur_freq", sbuf);
667
				jobacct->act_cpufreq =
658
				jobacct->act_cpufreq = (uint32_t)
668
					_update_weighted_freq(jobacct, sbuf);
659
					_current_freq(jobacct, sbuf);
669
				debug2("Task average frequency = %u "
660
				debug2("Task current frequency = %u "
670
				       "pid %d mem size %"PRIu64" %"PRIu64" "
661
				       "pid %d mem size %"PRIu64" %"PRIu64" "
671
				       "time %u(%u+%u)",
662
				       "time %u(%u+%u)",
672
				       jobacct->act_cpufreq,
663
				       jobacct->act_cpufreq,

Return to ticket 304