aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer
diff options
context:
space:
mode:
Diffstat (limited to 'lib/observer')
-rw-r--r--lib/observer/src/crashdump_viewer.erl31
-rw-r--r--lib/observer/src/crashdump_viewer_html.erl3
2 files changed, 22 insertions, 12 deletions
diff --git a/lib/observer/src/crashdump_viewer.erl b/lib/observer/src/crashdump_viewer.erl
index bf4910445b..3b8d17c7d9 100644
--- a/lib/observer/src/crashdump_viewer.erl
+++ b/lib/observer/src/crashdump_viewer.erl
@@ -1242,9 +1242,9 @@ indexify(Fd,Bin,N) ->
{Chunk,N1} =
case binary:last(Bin) of
$\n ->
- {<<$\n,Chunk0/binary>>,N+size(Bin)-1};
+ {<<$\n,Chunk0/binary>>,N+byte_size(Bin)-1};
_ ->
- {Chunk0,N+size(Bin)}
+ {Chunk0,N+byte_size(Bin)}
end,
indexify(Fd,Chunk,N1);
eof ->
@@ -2244,9 +2244,13 @@ atoms(SessionId,File,TW,Num) ->
[{_Id,Start}] ->
Fd = open(File),
pos_bof(Fd,Start),
- {Atoms,Cont} = get_atoms(Fd,1000),
- crashdump_viewer_html:atoms(SessionId,TW,Num,Atoms),
- atoms_chunks(Fd,SessionId,Cont);
+ case get_atoms(Fd,?items_chunk_size) of
+ {Atoms,Cont} ->
+ crashdump_viewer_html:atoms(SessionId,TW,Num,Atoms),
+ atoms_chunks(Fd,SessionId,Cont);
+ done ->
+ crashdump_viewer_html:atoms(SessionId,TW,Num,done)
+ end;
_ ->
crashdump_viewer_html:atoms(SessionId,TW,Num,done)
end.
@@ -2254,20 +2258,25 @@ atoms(SessionId,File,TW,Num) ->
get_atoms(Fd,Number) ->
case get_n_lines_of_tag(Fd,Number) of
{all,_,Lines} ->
+ close(Fd),
{Lines,done};
{part,_,Lines} ->
{Lines,Number};
empty ->
- {[],done}
+ close(Fd),
+ done
end.
-atoms_chunks(Fd,SessionId,done) ->
- close(Fd),
+atoms_chunks(_Fd,SessionId,done) ->
crashdump_viewer_html:atoms_chunk(SessionId,done);
atoms_chunks(Fd,SessionId,Number) ->
- {Atoms,Cont} = get_atoms(Fd,Number),
- crashdump_viewer_html:atoms_chunk(SessionId,Atoms),
- atoms_chunks(Fd,SessionId,Cont).
+ case get_atoms(Fd,Number) of
+ {Atoms,Cont} ->
+ crashdump_viewer_html:atoms_chunk(SessionId,Atoms),
+ atoms_chunks(Fd,SessionId,Cont);
+ done ->
+ atoms_chunks(Fd,SessionId,done)
+ end.
%%-----------------------------------------------------------------
diff --git a/lib/observer/src/crashdump_viewer_html.erl b/lib/observer/src/crashdump_viewer_html.erl
index d49023f9f6..24a80b1916 100644
--- a/lib/observer/src/crashdump_viewer_html.erl
+++ b/lib/observer/src/crashdump_viewer_html.erl
@@ -726,7 +726,8 @@ atoms(SessionId,TW,Num,FirstChunk) ->
Heading = "Atoms",
case FirstChunk of
done ->
- deliver_first(SessionId,[h1(Heading),
+ deliver_first(SessionId,[start_html_page(Heading),
+ h1(Heading),
warn(TW),
"No atoms were found in log",br(),
"Total number of atoms in node was ", Num,