Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Jul 16, 2024
1 parent f18d363 commit 2b444a2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Binary file modified pyroscope/pprof-bin/pkg/pprof_bin_bg.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions pyroscope/pprof-bin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ impl TrieReader {
let uleb = read_uleb128(&self.bytes[self.offs..]);
self.offs += uleb.1;
let _size = uleb.0;
let string = &self.bytes[self.offs..self.offs + size];
self.offs += size;
let string = &self.bytes[self.offs..self.offs + _size];
self.offs += _size;
res.push(string);
}
res
Expand Down
2 changes: 1 addition & 1 deletion pyroscope/pprof-bin/src/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl ProfileMerge {
for i in 0..self.tmp.len() {
let idx = self.tmp[i];
let dst = &mut self.sample_table.as_mut().unwrap().s[idx as usize].value;
let src = p.sample[self.tmp[i] as usize].value.clone();
let src = p.sample[i as usize].value.clone();
for j in 0..src.len() {
dst[j] += src[j];
}
Expand Down
5 changes: 3 additions & 2 deletions pyroscope/pyroscope.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,11 @@ const selectMergeStacktracesV2 = async (req, res) => {
ofs += profLen
}
start = process.hrtime?.bigint ? process.hrtime.bigint() : BigInt(0)
pprofBin.merge_tree(_ctxIdx, Uint8Array.from(profiles.data.slice(ofs)))
pprofBin.merge_tree(_ctxIdx, Uint8Array.from(profiles.data.slice(ofs)),
typeRegex.sampleType + ':' + typeRegex.sampleUnit)
const mergeTreeLat = (process.hrtime?.bigint ? process.hrtime.bigint() : BigInt(0)) - start
start = process.hrtime?.bigint ? process.hrtime.bigint() : BigInt(0)
const resp = pprofBin.export_tree(_ctxIdx)
const resp = pprofBin.export_tree(_ctxIdx, typeRegex.sampleType + ':' + typeRegex.sampleUnit)
const exportTreeLat = (process.hrtime?.bigint ? process.hrtime.bigint() : BigInt(0)) - start
req.log.debug(`merge_pprof: ${mergePprofLat / BigInt(1000000)}ms`)
req.log.debug(`merge_tree: ${mergeTreeLat / BigInt(1000000)}ms`)
Expand Down

0 comments on commit 2b444a2

Please sign in to comment.