diff options
author | Mike Pall <mike> | 2013-09-08 02:50:48 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2013-09-08 02:50:48 +0200 |
commit | d3d30d389b504495d054d71bdee0fe2677d4b44c (patch) | |
tree | f7be7158fef10a4da52e3a1b48d9aa0d4d3ec994 | |
parent | f8e36535f79a2bbd192f99888cb0c4642fb87f4f (diff) | |
download | luajit-d3d30d389b504495d054d71bdee0fe2677d4b44c.tar.gz luajit-d3d30d389b504495d054d71bdee0fe2677d4b44c.tar.bz2 luajit-d3d30d389b504495d054d71bdee0fe2677d4b44c.zip |
Add notice when no samples were collected by -jp.
-rw-r--r-- | src/jit/p.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/jit/p.lua b/src/jit/p.lua index a93172da..75d93215 100644 --- a/src/jit/p.lua +++ b/src/jit/p.lua | |||
@@ -119,7 +119,6 @@ local function prof_top(count1, count2, samples, indent) | |||
119 | n = n + 1 | 119 | n = n + 1 |
120 | t[n] = k | 120 | t[n] = k |
121 | end | 121 | end |
122 | if not t[1] then return end | ||
123 | sort(t, function(a, b) return count1[a] > count1[b] end) | 122 | sort(t, function(a, b) return count1[a] > count1[b] end) |
124 | local raw = prof_raw | 123 | local raw = prof_raw |
125 | for i=1,min(n, prof_maxn) do | 124 | for i=1,min(n, prof_maxn) do |
@@ -148,7 +147,10 @@ local function prof_finish() | |||
148 | if prof_ud then | 147 | if prof_ud then |
149 | profile.stop() | 148 | profile.stop() |
150 | local samples = prof_samples | 149 | local samples = prof_samples |
151 | if samples == 0 then return end | 150 | if samples == 0 then |
151 | if prof_raw ~= true then out:write("[no samples collected]\n") end | ||
152 | return | ||
153 | end | ||
152 | prof_top(prof_count1, prof_count2, samples, "") | 154 | prof_top(prof_count1, prof_count2, samples, "") |
153 | prof_count1 = nil | 155 | prof_count1 = nil |
154 | prof_count2 = nil | 156 | prof_count2 = nil |