Skip to content

Commit

Permalink
debug: replace __FILE__ by RIOT_RELATIVE_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegHahm committed Sep 19, 2015
1 parent ac88d79 commit e15bdd2
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 30 deletions.
8 changes: 4 additions & 4 deletions core/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block, unsigned sta
}

DEBUG("msg_send() %s:%i: Sending from %" PRIkernel_pid " to %" PRIkernel_pid
". block=%i src->state=%i target->state=%i\n", __FILE__, __LINE__,
sched_active_pid, target_pid,
". block=%i src->state=%i target->state=%i\n", RIOT_FILE_RELATIVE,
__LINE__, sched_active_pid, target_pid,
block, sched_active_thread->status, target->status);

if (target->status != STATUS_RECEIVE_BLOCKED) {
DEBUG("msg_send() %s:%i: Target %" PRIkernel_pid " is not RECEIVE_BLOCKED.\n",
__FILE__, __LINE__, target_pid);
RIOT_FILE_RELATIVE, __LINE__, target_pid);

if (queue_msg(target, m)) {
DEBUG("msg_send() %s:%i: Target %" PRIkernel_pid
" has a msg_queue. Queueing message.\n", __FILE__,
" has a msg_queue. Queueing message.\n", RIOT_FILE_RELATIVE,
__LINE__, target_pid);
restoreIRQ(state);
if (sched_active_thread->status == STATUS_REPLY_BLOCKED) {
Expand Down
4 changes: 2 additions & 2 deletions cpu/lpc2387/lpc2387-adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ uint16_t adc_read(uint8_t channel)
}

adc_data = (regVal >> 6) & 0x3FF;
DEBUG("%s, %d: %lu\n", __FILE__, __LINE__, t1);
DEBUG("%s, %d: %lu\n", __FILE__, __LINE__, t2);
DEBUG("%s, %d: %lu\n", RIOT_FILE_RELATIVE, __LINE__, t1);
DEBUG("%s, %d: %lu\n", RIOT_FILE_RELATIVE, __LINE__, t2);
return (uint16_t) adc_data; /* return A/D conversion value */
}
11 changes: 6 additions & 5 deletions cpu/lpc2387/mci/lpc2387-mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ DSTATUS MCI_initialize(void)
do { /* Wait while card is busy state (use ACMD41 with HCS bit) */
/* This loop will take a time. Insert wai_tsk(1) here for multitask envilonment. */
if (xtimer_now() > start + 1000000/*!Timer[0]*/) {
DEBUG("%s, %d: Timeout #1\n", __FILE__, __LINE__);
DEBUG("%s, %d: Timeout #1\n", RIOT_FILE_RELATIVE, __LINE__);
goto di_fail;
}
}
Expand All @@ -579,12 +579,12 @@ DSTATUS MCI_initialize(void)
}

do { /* Wait while card is busy state (use ACMD41 or CMD1) */
DEBUG("%s, %d: %lX\n", __FILE__, __LINE__, resp[0]);
DEBUG("%s, %d: %lX\n", RIOT_FILE_RELATIVE, __LINE__, resp[0]);

/* This loop will take a time. Insert wai_tsk(1) here for multitask envilonment. */
if (xtimer_now() > start + 1000000/*!Timer[0]*/) {
DEBUG("now: %lu, started at: %lu\n", xtimer_now(), start);
DEBUG("%s, %d: Timeout #2\n", __FILE__, __LINE__);
DEBUG("%s, %d: Timeout #2\n", RIOT_FILE_RELATIVE, __LINE__);
goto di_fail;
}
}
Expand All @@ -597,7 +597,8 @@ DSTATUS MCI_initialize(void)
/*---- Card is 'ready' state ----*/

if (!send_cmd(CMD2, 0, 2, resp)) {
DEBUG("%s, %d: Failed entering ident state", __FILE__, __LINE__);
DEBUG("%s, %d: Failed entering ident state", RIOT_FILE_RELATIVE,
__LINE__);
goto di_fail; /* Enter ident state */
}

Expand All @@ -609,7 +610,7 @@ DSTATUS MCI_initialize(void)

if (ty & CT_SDC) { /* SDC: Get generated RCA and save it */
if (!send_cmd(CMD3, 0, 1, resp)) {
DEBUG("%s, %d: Failed generating RCA\n", __FILE__, __LINE__);
DEBUG("%s, %d: Failed generating RCA\n", RIOT_FILE_RELATIVE, __LINE__);
goto di_fail;
}

Expand Down
4 changes: 2 additions & 2 deletions cpu/msp430-common/include/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ extern "C" {
#ifndef NDEBUG
# define assert(assertion) \
if (!(assertion)) { \
printf("%s:%d: %s: Assertion '%s' failed", __FILE__, __LINE__, \
ASSERT_FUNC, #assertion); \
printf("%s:%d: %s: Assertion '%s' failed", RIOT_FILE_RELATIVE, \
__LINE__, ASSERT_FUNC, #assertion); \
abort(); \
}
#else
Expand Down
2 changes: 1 addition & 1 deletion cpu/stellaris_common/include/stellaris_periph/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extern void __error__(char *pcFilename, unsigned long ulLine);
#define ASSERT(expr) { \
if(!(expr)) \
{ \
__error__(__FILE__, __LINE__); \
__error__(RIOT_FILE_RELATIVE, __LINE__); \
} \
}
#else
Expand Down
4 changes: 2 additions & 2 deletions sys/crypto/3des.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ int tripledes_decrypt(const cipher_context_t *context, const uint8_t *crypt, uin

if (!key) {
DEBUG("%s:%d in %s: [ERROR] Could NOT malloc space for the des3_key_s struct.\r\n",
__FILE__, __LINE__, DEBUG_FUNC);
RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC);
return -1;
}

Expand All @@ -330,7 +330,7 @@ int tripledes_decrypt(const cipher_context_t *context, const uint8_t *crypt, uin

if (res < 0) {
DEBUG("%s:%d in %s: [ERROR] des3_key_setup failed with Code %i\r\n",
__FILE__, __LINE__, DEBUG_FUNC, res);
RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC, res);
free(key);
return -2;
}
Expand Down
7 changes: 4 additions & 3 deletions sys/include/embUnit/AssertImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void assertImplementationCStr(const char *expected,const char *actual, long line
__typeof__(expected_) ____expected__ = expected_; \
__typeof__(actual_) ____actual__ = actual_; \
if (stdimpl_strcmp(____expected__, ____actual__) != 0) { \
assertImplementationCStr(____expected__, ____actual__, __LINE__, __FILE__); \
assertImplementationCStr(____expected__, ____actual__, __LINE__, RIOT_FILE_RELATIVE); \
return; \
} \
} while (0)
Expand All @@ -59,7 +59,8 @@ void assertImplementationCStr(const char *expected,const char *actual, long line
long long ____expected__ = (long long) (expected_); \
long long ____actual__ = (long long) (actual_); \
if (____expected__ != ____actual__) { \
assertImplementationLongLong(____expected__, ____actual__, __LINE__, __FILE__); \
assertImplementationLongLong(____expected__, ____actual__, \
__LINE__, RIOT_FILE_RELATIVE); \
return; \
} \
} while (0)
Expand Down Expand Up @@ -91,7 +92,7 @@ void assertImplementationCStr(const char *expected,const char *actual, long line

#define TEST_FAIL(message) \
do { \
addFailure((message), __LINE__, __FILE__); \
addFailure((message), __LINE__, RIOT_FILE_RELATIVE); \
return; \
} while (0)

Expand Down
17 changes: 10 additions & 7 deletions sys/net/routing/nhdp/iib_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void iib_fill_wr_addresses(kernel_pid_t if_pid, struct rfc5444_writer *wr)
default:
/* Should not happen */
DEBUG("%s:%d in %s: [WARNING] Unknown link tuple status\n",
__FILE__, __LINE__, DEBUG_FUNC);
RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC);
break;
}
}
Expand Down Expand Up @@ -261,8 +261,9 @@ void iib_process_metric_msg(iib_link_set_entry_t *ls_entry, uint64_t int_time)
/* NHDP_METRIC is not set properly */
(void)ls_entry;
(void)int_time;
DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n", __FILE__,
__LINE__, DEBUG_FUNC); #endif
DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n",
RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC);
#endif
}

void iib_process_metric_pckt(iib_link_set_entry_t *ls_entry, uint32_t metric_out, uint16_t seq_no)
Expand Down Expand Up @@ -333,8 +334,9 @@ void iib_process_metric_pckt(iib_link_set_entry_t *ls_entry, uint32_t metric_out
(void)ls_entry;
(void)metric_out;
(void)seq_no;
DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n", __FILE__,
__LINE__, DEBUG_FUNC); #endif
DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n",
RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC);
#endif
}

void iib_process_metric_refresh(void)
Expand All @@ -345,8 +347,9 @@ void iib_process_metric_refresh(void)
dat_metric_refresh();
#else
/* NHDP_METRIC is not set properly */
DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n", __FILE__,
__LINE__, DEBUG_FUNC); #endif
DEBUG("%s:%d in %s: [WARNING] Unknown NHDP_METRIC setting\n",
RIOT_FILE_RELATIVE, __LINE__, DEBUG_FUNC);
#endif
}


Expand Down
9 changes: 5 additions & 4 deletions sys/trickle/trickle.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ void trickle_interval(trickle_t *trickle)
DEBUG("TRICKLE new Interval %" PRIu32 "\n", trickle->I);

if (trickle->I == 0) {
DEBUG("%s:%d in %s: [WARNING] Interval was 0\n", __FILE__, __LINE__,
DEBUG_FUNC);
DEBUG("%s:%d in %s: [WARNING] Interval was 0\n", RIOT_FILE_RELATIVE,
__LINE__, DEBUG_FUNC);

if (trickle->Imax == 0) {
DEBUG("%s:%d in %s: [WARNING] Imax == 0\n", __FILE__, __LINE__,
DEBUG_FUNC); }
DEBUG("%s:%d in %s: [WARNING] Imax == 0\n", RIOT_FILE_RELATIVE,
__LINE__, DEBUG_FUNC);
}

trickle->I = (trickle->Imin << trickle->Imax);
}
Expand Down

0 comments on commit e15bdd2

Please sign in to comment.