Lines Matching full:tz
57 struct tz { struct
66 struct tz *tz; argument
105 config_setting_t *tz; in configuration_init() local
127 tz = config_lookup(&cfg, "thermal-zones"); in configuration_init()
128 if (!tz) { in configuration_init()
133 length = config_setting_length(tz); in configuration_init()
143 node = config_setting_get_elem(tz, i); in configuration_init()
262 struct tz *tz; in thermometer_add_tz() local
272 tz = realloc(thermometer->tz, sizeof(*thermometer->tz) * (thermometer->nr_tz + 1)); in thermometer_add_tz()
273 if (!tz) { in thermometer_add_tz()
274 ERROR("Failed to allocate thermometer->tz\n"); in thermometer_add_tz()
278 thermometer->tz = tz; in thermometer_add_tz()
279 thermometer->tz[thermometer->nr_tz].fd_temp = fd; in thermometer_add_tz()
280 thermometer->tz[thermometer->nr_tz].name = strdup(name); in thermometer_add_tz()
281 thermometer->tz[thermometer->nr_tz].polling = polling; in thermometer_add_tz()
344 struct tz *tz = arg; in timer_temperature_callback() local
347 pread(tz->fd_temp, buf, sizeof(buf), 0); in timer_temperature_callback()
349 fprintf(tz->file_out, "%ld %s", getuptimeofday_ms(), buf); in timer_temperature_callback()
374 thermometer->tz[i].name, options->postfix); in thermometer_start()
387 fprintf(f, "timestamp(ms) %s(°mC)\n", thermometer->tz[i].name); in thermometer_start()
389 thermometer->tz[i].file_out = f; in thermometer_start()
391 DEBUG("Created '%s' file for thermal zone '%s'\n", path, thermometer->tz[i].name); in thermometer_start()
396 thermometer->tz[i].fd_timer = timerfd_create(CLOCK_MONOTONIC, 0); in thermometer_start()
397 if (thermometer->tz[i].fd_timer < 0) { in thermometer_start()
399 thermometer->tz[i].name); in thermometer_start()
404 thermometer->tz[i].name, thermometer->tz[i].polling); in thermometer_start()
407 msec_to_timespec(thermometer->tz[i].polling); in thermometer_start()
409 if (timerfd_settime(thermometer->tz[i].fd_timer, 0, in thermometer_start()
413 if (mainloop_add(thermometer->tz[i].fd_timer, in thermometer_start()
415 &thermometer->tz[i])) in thermometer_start()
528 fclose(thermometer->tz[i].file_out); in thermometer_stop()