You should call your physician, coughing up blood can be a serious symptom. Please don't wait
It could be related to the smoking or not related to the smoking (for an exaggerated example, a person who was a smoker but also had tuberculosis would cough up blood but it would not have much to do with the smoking). I would go get diagnosed.