The first answer that springs to mind is to add a parameter to stored proc A:
CREATE sprocA @calledby char(1)=NULL AS...
Then when you call it from sprocB, call it by using " EXEC sprocA 'B' ", while when calling it independently, use " EXEC sprocA ". You can then interrogate parameter @calledby to determine whether sprocB called it.
Hope this helps.