|
@@ -1,8 +1,36 @@
|
|
|
-#include <stdio.h>
|
|
|
-#include "dmmlib/block_header.h"
|
|
|
+/*
|
|
|
+ * Copyright 2012 Institute of Communication and Computer Systems (ICCS)
|
|
|
+ *
|
|
|
+ * Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
+ * you may not use this file except in compliance with the License.
|
|
|
+ * You may obtain a copy of the License at
|
|
|
+ *
|
|
|
+ * http://www.apache.org/licenses/LICENSE-2.0
|
|
|
+ *
|
|
|
+ * Unless required by applicable law or agreed to in writing, software
|
|
|
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
+ * See the License for the specific language governing permissions and
|
|
|
+ * limitations under the License.
|
|
|
+ *
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * @file debug.c
|
|
|
+ * @author Ioannis Koutras (joko@microlab.ntua.gr)
|
|
|
+ * @date September 2012
|
|
|
+ * @brief Debug functions implementation
|
|
|
+ */
|
|
|
+
|
|
|
+#include "debug.h"
|
|
|
+
|
|
|
+#ifdef FL_RB_ONLY
|
|
|
+#include "freelist/block_header.h"
|
|
|
#include "freelist/block_header_funcs.h"
|
|
|
#include "freelist/linked_lists/search_algorithms.h"
|
|
|
-#include "debug.h"
|
|
|
+#endif /* FL_RB_ONLY */
|
|
|
+
|
|
|
+#include "trace.h"
|
|
|
|
|
|
void get_raw_blocks(allocator_t *allocator) {
|
|
|
int counter;
|
|
@@ -13,16 +41,18 @@ void get_raw_blocks(allocator_t *allocator) {
|
|
|
|
|
|
while(current_raw_block) {
|
|
|
counter++;
|
|
|
- printf("Raw block at %p with remaining size %zu\n",
|
|
|
+ TRACE_1("dmmlib - Raw block at %p of size %zu\n",
|
|
|
(void *)current_raw_block,
|
|
|
- current_raw_block->remaining_size);
|
|
|
+ current_raw_block->size);
|
|
|
current_raw_block = current_raw_block->next_raw_block;
|
|
|
}
|
|
|
|
|
|
- printf("There are %d raw blocks\n", counter);
|
|
|
+ TRACE_1("dmmlib - there are %d raw blocks\n", counter);
|
|
|
|
|
|
}
|
|
|
|
|
|
+#ifdef FL_RB_ONLY
|
|
|
+
|
|
|
void get_memory_blocks(raw_block_header_t *raw_block) {
|
|
|
block_header_t *memory_block;
|
|
|
int counter;
|
|
@@ -37,6 +67,8 @@ void get_memory_blocks(raw_block_header_t *raw_block) {
|
|
|
memory_block = memory_block->next;
|
|
|
}
|
|
|
|
|
|
- printf("Raw block at %p has %d memory blocks\n",
|
|
|
+ TRACE_1("Raw block at %p has %d memory blocks\n",
|
|
|
(void *)raw_block, counter);
|
|
|
}
|
|
|
+
|
|
|
+#endif /* FL_RB_ONLY */
|