Skip to content

Commit 25c4e53

Browse files
Stephen HemmingerDavid S. Miller
authored andcommitted
[PKTGEN]: use pr_debug
Remove private debug macro and replace with standard version Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Robert Olsson <robert.olsson@its.uu.se> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fa438cc commit 25c4e53

1 file changed

Lines changed: 15 additions & 19 deletions

File tree

‎net/core/pktgen.c‎

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@
164164

165165
#define VERSION "pktgen v2.68: Packet Generator for packet performance testing.\n"
166166

167-
/* #define PG_DEBUG(a) a */
168-
#define PG_DEBUG(a)
169-
170167
/* The buckets are exponential in 'width' */
171168
#define LAT_BUCKETS_MAX 32
172169
#define IP_NAME_SZ 32
@@ -1857,8 +1854,7 @@ static int pktgen_mark_device(const char *ifname)
18571854
int ret = 0;
18581855

18591856
mutex_lock(&pktgen_thread_lock);
1860-
PG_DEBUG(printk("pktgen: pktgen_mark_device marking %s for removal\n",
1861-
ifname));
1857+
pr_debug("pktgen: pktgen_mark_device marking %s for removal\n", ifname);
18621858

18631859
while (1) {
18641860

@@ -1867,8 +1863,8 @@ static int pktgen_mark_device(const char *ifname)
18671863
break; /* success */
18681864

18691865
mutex_unlock(&pktgen_thread_lock);
1870-
PG_DEBUG(printk("pktgen: pktgen_mark_device waiting for %s "
1871-
"to disappear....\n", ifname));
1866+
pr_debug("pktgen: pktgen_mark_device waiting for %s "
1867+
"to disappear....\n", ifname);
18721868
schedule_timeout_interruptible(msecs_to_jiffies(msec_per_try));
18731869
mutex_lock(&pktgen_thread_lock);
18741870

@@ -2848,7 +2844,7 @@ static void pktgen_run(struct pktgen_thread *t)
28482844
struct pktgen_dev *pkt_dev;
28492845
int started = 0;
28502846

2851-
PG_DEBUG(printk("pktgen: entering pktgen_run. %p\n", t));
2847+
pr_debug("pktgen: entering pktgen_run. %p\n", t);
28522848

28532849
if_lock(t);
28542850
list_for_each_entry(pkt_dev, &t->if_list, list) {
@@ -2880,7 +2876,7 @@ static void pktgen_stop_all_threads_ifs(void)
28802876
{
28812877
struct pktgen_thread *t;
28822878

2883-
PG_DEBUG(printk("pktgen: entering pktgen_stop_all_threads_ifs.\n"));
2879+
pr_debug("pktgen: entering pktgen_stop_all_threads_ifs.\n");
28842880

28852881
mutex_lock(&pktgen_thread_lock);
28862882

@@ -2948,7 +2944,7 @@ static void pktgen_run_all_threads(void)
29482944
{
29492945
struct pktgen_thread *t;
29502946

2951-
PG_DEBUG(printk("pktgen: entering pktgen_run_all_threads.\n"));
2947+
pr_debug("pktgen: entering pktgen_run_all_threads.\n");
29522948

29532949
mutex_lock(&pktgen_thread_lock);
29542950

@@ -3040,7 +3036,7 @@ static void pktgen_stop(struct pktgen_thread *t)
30403036
{
30413037
struct pktgen_dev *pkt_dev;
30423038

3043-
PG_DEBUG(printk("pktgen: entering pktgen_stop\n"));
3039+
pr_debug("pktgen: entering pktgen_stop\n");
30443040

30453041
if_lock(t);
30463042

@@ -3064,7 +3060,7 @@ static void pktgen_rem_one_if(struct pktgen_thread *t)
30643060
struct list_head *q, *n;
30653061
struct pktgen_dev *cur;
30663062

3067-
PG_DEBUG(printk("pktgen: entering pktgen_rem_one_if\n"));
3063+
pr_debug("pktgen: entering pktgen_rem_one_if\n");
30683064

30693065
if_lock(t);
30703066

@@ -3093,7 +3089,7 @@ static void pktgen_rem_all_ifs(struct pktgen_thread *t)
30933089

30943090
/* Remove all devices, free mem */
30953091

3096-
PG_DEBUG(printk("pktgen: entering pktgen_rem_all_ifs\n"));
3092+
pr_debug("pktgen: entering pktgen_rem_all_ifs\n");
30973093
if_lock(t);
30983094

30993095
list_for_each_safe(q, n, &t->if_list) {
@@ -3276,7 +3272,7 @@ static int pktgen_thread_worker(void *arg)
32763272

32773273
t->pid = current->pid;
32783274

3279-
PG_DEBUG(printk("pktgen: starting pktgen/%d: pid=%d\n", cpu, current->pid));
3275+
pr_debug("pktgen: starting pktgen/%d: pid=%d\n", cpu, current->pid);
32803276

32813277
max_before_softirq = t->max_before_softirq;
32823278

@@ -3339,13 +3335,13 @@ static int pktgen_thread_worker(void *arg)
33393335
set_current_state(TASK_INTERRUPTIBLE);
33403336
}
33413337

3342-
PG_DEBUG(printk("pktgen: %s stopping all device\n", t->tsk->comm));
3338+
pr_debug("pktgen: %s stopping all device\n", t->tsk->comm);
33433339
pktgen_stop(t);
33443340

3345-
PG_DEBUG(printk("pktgen: %s removing all device\n", t->tsk->comm));
3341+
pr_debug("pktgen: %s removing all device\n", t->tsk->comm);
33463342
pktgen_rem_all_ifs(t);
33473343

3348-
PG_DEBUG(printk("pktgen: %s removing thread.\n", t->tsk->comm));
3344+
pr_debug("pktgen: %s removing thread.\n", t->tsk->comm);
33493345
pktgen_rem_thread(t);
33503346

33513347
return 0;
@@ -3364,7 +3360,7 @@ static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t,
33643360
}
33653361

33663362
if_unlock(t);
3367-
PG_DEBUG(printk("pktgen: find_dev(%s) returning %p\n", ifname, pkt_dev));
3363+
pr_debug("pktgen: find_dev(%s) returning %p\n", ifname, pkt_dev);
33683364
return pkt_dev;
33693365
}
33703366

@@ -3533,7 +3529,7 @@ static int pktgen_remove_device(struct pktgen_thread *t,
35333529
struct pktgen_dev *pkt_dev)
35343530
{
35353531

3536-
PG_DEBUG(printk("pktgen: remove_device pkt_dev=%p\n", pkt_dev));
3532+
pr_debug("pktgen: remove_device pkt_dev=%p\n", pkt_dev);
35373533

35383534
if (pkt_dev->running) {
35393535
printk("pktgen:WARNING: trying to remove a running interface, stopping it now.\n");

0 commit comments

Comments
 (0)