<div dir="ltr">Personally I prefer generic get_parent_stats as I will still need to read the whole structure from image an allocate memory for it anyway.<br>
</div><div dir="ltr"><br>
</div><div dir="ltr">__maybe_unused should've been removed in next patch, oops.<br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div dir="ltr"><br>
</div><div class="wps_signature">Best regards, Tikhomirov Pavel.</div><div class="wps_quotion">Dmitry Safonov <0x7f454c46@gmail.com> | От: 9 февр. 2018 г. 19:50 | Сообщение:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p></p><p dir="ltr">2018-02-09 16:06 GMT+00:00 Pavel Tikhomirov <<a href="mailto:ptikhomirov@virtuozzo.com">ptikhomirov@virtuozzo.com</a>>:
<br>
> will be used in the next patch
<br>
>
<br>
> <a href="https://jira.sw.ru/browse/PSBM-67502">https://jira.sw.ru/browse/PSBM-67502</a>
<br>
>
<br>
> Signed-off-by: Pavel Tikhomirov <<a href="mailto:ptikhomirov@virtuozzo.com">ptikhomirov@virtuozzo.com</a>>
<br>
> ---
<br>
> criu/include/stats.h | 2 ++
<br>
> criu/stats.c | 31 +++++++++++++++++++++++++++++++
<br>
> 2 files changed, 33 insertions(+)
<br>
>
<br>
> diff --git a/criu/include/stats.h b/criu/include/stats.h
<br>
> index 81775c856..8694d9fb7 100644
<br>
> --- a/criu/include/stats.h
<br>
> +++ b/criu/include/stats.h
<br>
> @@ -23,6 +23,8 @@ extern void timing_start(int t);
<br>
> extern void timing_stop(int t);
<br>
> extern int timing_uptime(int t);
<br>
>
<br>
> +extern int get_parent_stats(void **se);
<br>
<br>
Because dynamic typing and Python are great?
<br>
I know, you're trying to decrease nr of includes..
<br>
But will that work for you if it's not get_parent_stats(),
<br>
but get_parent_uptime() which will return parsed uint64_t?
<br>
Then we'll still be able to enjoy C99's static typing..
<br>
<br>
> +
<br>
> enum {
<br>
> CNT_PAGES_SCANNED,
<br>
> CNT_PAGES_SKIPPED_PARENT,
<br>
> diff --git a/criu/stats.c b/criu/stats.c
<br>
> index 2944474cd..5c05b1e68 100644
<br>
> --- a/criu/stats.c
<br>
> +++ b/criu/stats.c
<br>
> @@ -213,6 +213,37 @@ void write_stats(int what)
<br>
> display_stats(what, &stats);
<br>
> }
<br>
>
<br>
> +__maybe_unused int get_parent_stats(void **se)
<br>
<br>
Failed to remove __maybe_unused somewhere,
<br>
not nice.
<br>
<br>
--
<br>
Dmitry
<br>
</p>
</blockquote></div>