Recently one of my profs (other than my advisor) told me that I am not doing well in his subject. Should I tell this to my advisor? Actually the reason of me not doing well is doing other jobs assigned by my advisor to me like advising undergraduates. Undergraduates don't let me do my work. And whenever I am busy doing my own research and due to this when I politely refuse them, they say that they will go and complain about me to my advisor. Please help I am really stuck as to how to deal with the situation?
Yes. Talk to your advisor.
It is really important you learn to, in a good way, think of yourself. Right now, the undergraduates are happy (they get help) but your work is suffering. I can imagine that helping undergraduates is part of your job description, but not to the point you cannot work anymore yourself. You need to sit down with your professor and your supervisor and discuss that your undergraduate workload is too much. Best is to have a proposal ready yourself, e.g. that you want to spend a day a week helping undergraduates and that that is the limit. Once you get both your professor and your supervisor to agree, no undergraduate can manipulate you into helping him/her. In addition, everyone is clear on their expectations, this is the professional way of dealing with this in my opinion.
If you do not set boundaries, you will be the only one suffering. The professor and supervisor will feel somewhat bad, but the undergraduates will find a new person to stalk, while you are left without a PhD.