It is ok for a police officer to use a firearm should they be threatened with bodily harm using a blunt force weapon by a perpetrator. It doesnt matter whether the perpetrator has a knife, billy club, nun chuks, a bull whip, ninja sword or any other blunt force weapon, all of these have the potential to kill a human being.
It really depends on the situation. Are they actively trying to stab you or run you down with a car? That's a situation where you take them down however you can, but the reality is that many police officers are escalating an issue that didn't need gun violence and they are prematurely killing people who could be restrained in other ways.
If a criminal is in mid-swing about to decapitate an individual with a samurai sword I would say the police would be taking correct action by shooting him. Even a blunt instrument can do damage if a man much larger than the police officer is repeatedly bludgeoning a man with a baseball bat and will cause serious damage then use a firearm should be discharged.
If a thug is about to stab a cop than of course the cop should shoot him. Cops matter more than violent criminals so if a violent criminal tries to harm or kill a cop the cop has every right to defend him self. I'd like to see BLM supporters do what cops do every day before they judge them.
Let's face it if the officer is in a situation where the perpetrator has a knife and holding a hostage with it ready to stab them then the police officer has a right to shoot them to kill. However, this is an extreme situation but if they just have a knife waving it around than the only thing necessary is to stop them from being a threat and that is to shoot maybe the arm that knife is held in to get them to drop it. But there is no reason to shoot them down killing them.
There should be no "hard and fast" rule about when a police officer should shoot a perpetrator. The rule is that a police officer can shoot if their life or the lives of others are in danger. So if a perpetrator is attacking someone with a knife or has a grenade about to blow up tens of people then this would be okay to me. It depends on the weapon and the situation 100%.