What are the differences of dpm and dsm for the devel module? I mainly use dsm for the devel module. What are some other common debugging functions that are useful in the devel module?

  • 1
    I answered "differences" part. "Some other common debugging functions" would render this question too broad in my eyes, consider removing it. Especially when it is already covered by demo page linked fom project page.
    – Mołot
    Commented Oct 20, 2014 at 18:09
  • Even that doc is a little wrong, as dpm() will normally use krumo and not print_r.
    – mpdonadio
    Commented Oct 20, 2014 at 18:47

2 Answers 2


From the documentation:

Legacy function that was poorly named.

Use dpm() instead, since the 'p' maps to 'print_r'.


function dsm($input, $name = NULL) {
  return dpm($input, $name);

So there is no real difference, except the function you are using is left there for developers that failed to switch when it was renamed.


dpm() prints a variable to the ‘message’ area of the page using drupal_set_message(). The output and compact and less likely to break the layout of your page.

From the devel docs:

A note from the devel module: dsm() is a legacy function that was poorly named; use dpm() instead, since the 'p' maps to 'print_r'.

I think we should trust the devel folks on that one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.