Trace log access to cache system
This commit is contained in:
@@ -353,6 +353,14 @@ impl binemit::RelocSink for RelocSink {
|
|||||||
) {
|
) {
|
||||||
panic!("trampoline compilation should not produce external symbol relocs");
|
panic!("trampoline compilation should not produce external symbol relocs");
|
||||||
}
|
}
|
||||||
|
fn reloc_constant(
|
||||||
|
&mut self,
|
||||||
|
_code_offset: binemit::CodeOffset,
|
||||||
|
_reloc: binemit::Reloc,
|
||||||
|
_constant_offset: ir::ConstantOffset,
|
||||||
|
) {
|
||||||
|
panic!("trampoline compilation should not produce constant relocs");
|
||||||
|
}
|
||||||
fn reloc_jt(
|
fn reloc_jt(
|
||||||
&mut self,
|
&mut self,
|
||||||
_offset: binemit::CodeOffset,
|
_offset: binemit::CodeOffset,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use cranelift_codegen::{ir, isa};
|
|||||||
use cranelift_entity::PrimaryMap;
|
use cranelift_entity::PrimaryMap;
|
||||||
use cranelift_wasm::DefinedFuncIndex;
|
use cranelift_wasm::DefinedFuncIndex;
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
use log::{debug, warn};
|
use log::{debug, trace, warn};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
use std::fs;
|
use std::fs;
|
||||||
@@ -241,6 +241,7 @@ impl ModuleCacheEntry {
|
|||||||
|
|
||||||
pub fn get_data(&self) -> Option<ModuleCacheData> {
|
pub fn get_data(&self) -> Option<ModuleCacheData> {
|
||||||
let path = self.mod_cache_path.as_ref()?;
|
let path = self.mod_cache_path.as_ref()?;
|
||||||
|
trace!("get_data() for path: {}", path.display());
|
||||||
let compressed_cache_bytes = fs::read(path).ok()?;
|
let compressed_cache_bytes = fs::read(path).ok()?;
|
||||||
let cache_bytes = zstd::decode_all(&compressed_cache_bytes[..])
|
let cache_bytes = zstd::decode_all(&compressed_cache_bytes[..])
|
||||||
.map_err(|err| warn!("Failed to decompress cached code: {}", err))
|
.map_err(|err| warn!("Failed to decompress cached code: {}", err))
|
||||||
@@ -256,6 +257,7 @@ impl ModuleCacheEntry {
|
|||||||
|
|
||||||
fn update_data_impl(&self, data: &ModuleCacheData) -> Option<()> {
|
fn update_data_impl(&self, data: &ModuleCacheData) -> Option<()> {
|
||||||
let path = self.mod_cache_path.as_ref()?;
|
let path = self.mod_cache_path.as_ref()?;
|
||||||
|
trace!("update_data() for path: {}", path.display());
|
||||||
let serialized_data = bincode::serialize(&data)
|
let serialized_data = bincode::serialize(&data)
|
||||||
.map_err(|err| warn!("Failed to serialize cached code: {}", err))
|
.map_err(|err| warn!("Failed to serialize cached code: {}", err))
|
||||||
.ok()?;
|
.ok()?;
|
||||||
|
|||||||
Reference in New Issue
Block a user