Lines Matching refs:rc6
38 int rc6_init(struct rc6 *rc6) in rc6_init() argument
40 memset(rc6, 0, sizeof(*rc6)); in rc6_init()
42 rc6->fd = perf_i915_open(I915_PMU_RC6_RESIDENCY); in rc6_init()
43 if (rc6->fd < 0) { in rc6_init()
46 return rc6->error = errno; in rc6_init()
82 int rc6_update(struct rc6 *rc6) in rc6_update() argument
84 struct rc6_stat *s = &rc6->stat[rc6->count++&1]; in rc6_update()
85 struct rc6_stat *d = &rc6->stat[rc6->count&1]; in rc6_update()
88 if (rc6->error) in rc6_update()
89 return rc6->error; in rc6_update()
91 if (rc6->fd < 0) { in rc6_update()
95 return rc6->error = ENOENT; in rc6_update()
104 if (read(rc6->fd, data, sizeof(data)) < sizeof(data)) in rc6_update()
105 return rc6->error = errno; in rc6_update()
111 if (rc6->count == 1) in rc6_update()
116 rc6->count--; in rc6_update()
121 rc6->rc6 = 100 * d_rc6 / d_time; in rc6_update()
124 rc6->rc6p = 100 * d_rc6p / d_time; in rc6_update()
127 rc6->rc6pp = 100 * d_rc6pp / d_time; in rc6_update()
129 rc6->rc6_combined = 100 * (d_rc6 + d_rc6p + d_rc6pp) / d_time; in rc6_update()