Skip to content

Commit

Permalink
add some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
hnwyllmm committed Nov 13, 2024
1 parent 2429115 commit 6d88bc0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions deps/common/log/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ int Log::out(const LOG_LEVEL console_level, const LOG_LEVEL log_level, T &msg)
do { \
if (!(expression)) { \
LOG_PANIC(description, ##__VA_ARGS__); \
LOG_PANIC("%s", lbt()); \
assert(expression); \
} \
} while (0)
Expand Down
5 changes: 3 additions & 2 deletions src/observer/storage/buffer/disk_buffer_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ RC DiskBufferPool::allocate_page(Frame **frame)

hdr_frame_->set_lsn(lsn);

LOG_INFO("allocate a new page without extend buffer pool. page num=%d, buffer pool=%d", i, id());
lock_.unlock();
return get_this_page(i, frame);
}
Expand Down Expand Up @@ -401,7 +402,7 @@ RC DiskBufferPool::allocate_page(Frame **frame)
return rc;
}

LOG_INFO("allocate new page. file=%s, pageNum=%d, pin=%d",
LOG_INFO("allocate new page by extending bufferpool. file=%s, pageNum=%d, pin=%d",
file_name_.c_str(), page_num, allocated_frame->pin_count());

file_header_->allocated_pages++;
Expand Down Expand Up @@ -705,7 +706,7 @@ RC DiskBufferPool::allocate_frame(PageNum page_num, Frame **buffer)
Frame *frame = frame_manager_.alloc(id(), page_num);
if (frame != nullptr) {
*buffer = frame;
LOG_DEBUG("allocate frame %p, page num %d", frame, page_num);
LOG_DEBUG("allocate frame %p, page num %d, frame=%s", frame, page_num, frame->to_string().c_str());
return RC::SUCCESS;
}

Expand Down
2 changes: 1 addition & 1 deletion src/observer/storage/buffer/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,6 @@ string Frame::to_string() const
{
stringstream ss;
ss << "frame id:" << frame_id().to_string() << ", dirty=" << dirty() << ", pin=" << pin_count()
<< ", lsn=" << lsn();
<< ", lsn=" << lsn() << ", this=" << this;
return ss.str();
}

0 comments on commit 6d88bc0

Please sign in to comment.