1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-07 20:54:32 +00:00

Improve 'pdumper-stats' and its documentation

* src/pdumper.c (Fpdumper_stats): Improve formatting and
wording of the doc string.  Decode the pdump file name and
expand-file-name it.

* doc/lispref/internals.texi (Building Emacs): Document
'pdumper-stats'.
This commit is contained in:
Eli Zaretskii 2019-01-19 20:09:38 +02:00
parent 436c225f1b
commit 8bb5939efa
2 changed files with 39 additions and 12 deletions

View File

@ -225,6 +225,18 @@ Emacs was built without @code{unexec} support, this function will not
be available.
@end defun
@defun pdumper-stats
If the current Emacs session restored its state from a portable dump
file, this function returns information about the dump file and the
time it took to restore the Emacs state. The value is an alist
@w{@code{((dumped-with-pdumper . t) (load-time . @var{time})
(dump-file-name . @var{file}))}},
where @var{file} is the name of the dump file, and @var{time} is the
time in milliseconds it took to restore the state from the dump file.
If the current session was not restored from a portable dump file, the
value is nil.
@end defun
@node Pure Storage
@section Pure Storage
@cindex pure storage

View File

@ -5568,23 +5568,38 @@ pdumper_load (const char *dump_filename)
return err;
}
DEFUN ("pdumper-stats",
Fpdumper_stats, Spdumper_stats,
0, 0, 0,
doc: /* Return an alist of statistics about dump file that
started this Emacs, if any. Nil if this Emacs was not
started using a portable dumper dump file.*/)
DEFUN ("pdumper-stats", Fpdumper_stats, Spdumper_stats, 0, 0, 0,
doc: /* Return statistics about portable dumping used by this session.
If this Emacs sesion was started from a portable dump file,
the return value is an alist of the form:
((dumped-with-pdumper . t) (load-time . TIME) (dump-file-name . FILE))
where TIME is the time in milliseconds it took to restore Emacs state
from the dump file, and FILE is the name of the dump file.
Value is nil if this session was not started using a portable dump file.*/)
(void)
{
if (!dumped_with_pdumper_p ())
return Qnil;
return CALLN (
Flist,
Fcons (Qdumped_with_pdumper, Qt),
Fcons (Qload_time, make_float (dump_private.load_time)),
Fcons (Qdump_file_name,
build_unibyte_string (dump_private.dump_filename)));
Lisp_Object dump_fn;
#ifdef WINDOWSNT
char dump_fn_utf8[MAX_UTF8_PATH];
if (filename_from_ansi (dump_private.dump_filename, dump_fn_utf8) == 0)
dump_fn = DECODE_FILE (build_unibyte_string (dump_fn_utf8));
else
dump_fn = build_unibyte_string (dump_private.dump_filename);
#else
dump_fn = DECODE_FILE (build_unibyte_string (dump_private.dump_filename));
#endif
dump_fn = Fexpand_file_name (dump_fn, Qnil);
return CALLN (Flist,
Fcons (Qdumped_with_pdumper, Qt),
Fcons (Qload_time, make_float (dump_private.load_time)),
Fcons (Qdump_file_name, dump_fn));
}
#endif /* HAVE_PDUMPER */