"Barking up" this originated with hunting; a dog would sometimes make a mistake locating its prey
It's unfair to 
them expect to train them out of it (I'm not saying don't ..... We would be out riding 
and see a lawn guy up a tree with one of the Ridgys barking up the trunk.