0

I have included the following printk statement in tcp_cubic.c

static u32 bictcp_recalc_ssthresh(struct sock *sk)
{
  ..

  if (tp->snd_cwnd < ca->last_max_cwnd && fast_convergence)

      ca->last_max_cwnd = (tp->snd_cwnd * (BICTCP_BETA_SCALE + beta))
          / (2 * BICTCP_BETA_SCALE);
  else
      ca->last_max_cwnd = tp->snd_cwnd;

  ca->loss_cwnd = tp->snd_cwnd;


  printk(KERN_INFO "ssthresh is %s", snd_cwnd); // <<<--- here

  return max((tp->snd_cwnd * beta) / BICTCP_BETA_SCALE, 2U);

}

But it is not printing the values in dmesg or syslog. Why is that?

Mat
  • 202,337
  • 40
  • 393
  • 406
  • 2
    How are you sure that this function is called? Insert a `dumpstack()` function call in this function and make sure this function is getting called – Pavan Manjunath Apr 11 '12 at 07:23

1 Answers1

0

In Linux 3.1 (for example), DEFAULT_MESSAGE_LOGLEVEL value is 4 and KERN_INFO is 6. Try to print with something like KERN_ALERT (value is 1).

You can check or change your default loglevel by reading / modifying this proc file:

cat /proc/sys/kernel/printk 

See man 5 proc for more information on this file.

ouah
  • 142,963
  • 15
  • 272
  • 331
  • by changing to KERN_ALERT in tcp_cubic.c and seeing the output in cat /proc/sys/kernel/printk , it is showing 4 4 1 7. so i want to know as to what should i do after changing the printk statement in tcp_cubic.c, i,e should i compile or should i just see the syslog without compiling or should i do the insmod by writing a seperate Makefile for it. – Ashwini Gopalakrishna Apr 11 '12 at 08:14